com.jniwrapper.win32
Class LastErrorException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--com.jniwrapper.win32.LastErrorException
All Implemented Interfaces:
java.io.Serializable

public class LastErrorException
extends java.lang.RuntimeException

Exception that holds last error code taken when an instance is created.

See Also:
LastError, Serialized Form

Constructor Summary
LastErrorException()
          Constructs and new instance storing last error code and setting system error message.
LastErrorException(java.lang.String message)
          Constructs a new instance with the passed details message.
LastErrorException(java.lang.String message, boolean clearError)
          Constructs a new instance with the passed details message.
LastErrorException(java.lang.Throwable cause)
          Constructs a new instance with the cause.
 
Method Summary
 int getErrorCode()
           
 java.lang.String getErrorMessage()
           
 java.lang.String getMessage()
          Returns a combined message consisting of the details message passed on the construction and system error message that corresponds to the stored error code.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LastErrorException

public LastErrorException()
Constructs and new instance storing last error code and setting system error message. Stores the current value of the system error code for later retrieval by the getErrorCode() method.


LastErrorException

public LastErrorException(java.lang.String message)
Constructs a new instance with the passed details message. Stores the current value of the system error code for later retrieval by the getErrorCode() method. System error message for the stored error code should be retrieved by the getErrorMessage() method.

Parameters:
message - the details message.

LastErrorException

public LastErrorException(java.lang.String message,
                          boolean clearError)
Constructs a new instance with the passed details message. Stores the current value of the system error code for later retrieval by the getErrorCode() method. System error message for the stored error code should be retrieved by the getErrorMessage() method. This constructor clears the system error code depending on the value of the clearError parameter.

Parameters:
message - the detailed message.
clearError - if true the error code is cleared.

LastErrorException

public LastErrorException(java.lang.Throwable cause)
Constructs a new instance with the cause. Saves system error code that can be later queried by the getErrorCode() method.

Parameters:
cause - the cause saved for later retrieval.
Method Detail

getErrorCode

public int getErrorCode()
Returns:
system error code saved at construction time.

getErrorMessage

public java.lang.String getErrorMessage()
Returns:
system error message for the stored error code.

getMessage

public java.lang.String getMessage()
Returns a combined message consisting of the details message passed on the construction and system error message that corresponds to the stored error code. If the detail message was not configured returns error message. Detail and system error messages are separated by the space character.

Overrides:
getMessage in class java.lang.Throwable
Returns:
combined error message.