public class PWMException
extends java.lang.Exception
The exception stores information of which PWM channel caused it and the type of exception thrown.
Modifier and Type | Field and Description |
---|---|
protected int |
channelIndex |
protected int |
exceptionType |
static int |
PWM_CHANNEL_NOT_AVAILABLE
The provided PWM channel index is not available.
|
static int |
READING_ERROR
Error reading from PWM channel files.
|
static long |
serialVersionUID |
static int |
UNSPECIFIED_EXCEPTION
Any exception that does not specify a specific issue.
|
static int |
WRITING_ERROR
Error writing to PWM channel files.
|
Constructor and Description |
---|
PWMException(int channelIndex)
Constructs a PWMException for the given PWM channel index.
|
PWMException(int channelIndex,
int exceptionType)
Constructs a PWMException for the given PWM channel index and with the
given cause.
|
PWMException(int channelIndex,
int exceptionType,
java.lang.String message)
Constructs a PWMException for the given PWM channel index, exception
cause and detailed exception message.
|
PWMException(int channelIndex,
int exceptionType,
java.lang.String message,
java.lang.Throwable throwable)
Constructs a PWMException for the given PWM channel index, exception
cause, detailed message and parent exception.
|
PWMException(int channelIndex,
int exceptionType,
java.lang.Throwable throwable)
Constructs a PWMException for the given PWM channel index, exception
cause and parent exception.
|
Modifier and Type | Method and Description |
---|---|
int |
getPWMChannelIndex()
Retrieves the PWM channel index associated to this exception.
|
int |
getType()
Retrieves the exception type.
|
public static final long serialVersionUID
public static final int UNSPECIFIED_EXCEPTION
public static final int PWM_CHANNEL_NOT_AVAILABLE
public static final int READING_ERROR
public static final int WRITING_ERROR
protected int exceptionType
protected int channelIndex
public PWMException(int channelIndex)
channelIndex
- PWM channel index that threw the exception.public PWMException(int channelIndex, int exceptionType)
channelIndex
- PWM channel index that threw the exception.exceptionType
- Type of exception.PWM_CHANNEL_NOT_AVAILABLE
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public PWMException(int channelIndex, int exceptionType, java.lang.String message)
channelIndex
- PWM channel index that threw the exception.exceptionType
- Type of exception.message
- Additional message for the exception.PWM_CHANNEL_NOT_AVAILABLE
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public PWMException(int channelIndex, int exceptionType, java.lang.Throwable throwable)
channelIndex
- PWM channel index that threw the exception.exceptionType
- Type of exception.throwable
- Parent exception.PWM_CHANNEL_NOT_AVAILABLE
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public PWMException(int channelIndex, int exceptionType, java.lang.String message, java.lang.Throwable throwable)
channelIndex
- PWM channel index that threw the exception.exceptionType
- Type of exception.message
- Additional message for the exception.throwable
- Parent exception.PWM_CHANNEL_NOT_AVAILABLE
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR
public int getPWMChannelIndex()
public int getType()
UNSPECIFIED_EXCEPTION
if not explicitly set.PWM_CHANNEL_NOT_AVAILABLE
,
READING_ERROR
,
UNSPECIFIED_EXCEPTION
,
WRITING_ERROR