com.jniwrapper.win32
Class LastErrorException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.jniwrapper.win32.LastErrorException
All Implemented Interfaces:
java.io.Serializable

public class LastErrorException
extends java.lang.RuntimeException

This is an exception that holds the last error code taken when an instance is created.

See Also:
LastError, Serialized Form

Constructor Summary
LastErrorException()
          Deprecated. Use the LastErrorException(long) instead.
LastErrorException(long errorCode)
          Constructs a new instance storing the last error code and setting the system error message.
LastErrorException(long errorCode, java.lang.String message)
          Constructs a new instance with the passed details message.
LastErrorException(long errorCode, java.lang.String message, boolean clearError)
          Constructs a new instance with the passed details message.
LastErrorException(long errorCode, java.lang.Throwable cause)
          Constructs a new instance with the cause.
LastErrorException(java.lang.String message)
          Deprecated. Use the LastErrorException(long, String) instead.
LastErrorException(java.lang.String message, boolean clearError)
          Deprecated. Use the LastErrorException(long, String, boolean) instead.
LastErrorException(java.lang.String message, java.lang.Throwable cause)
          Constructs a new instance with the cause.
LastErrorException(java.lang.Throwable cause)
          Deprecated. Use the LastErrorException(long, Throwable) instead.
 
Method Summary
 long getErrorCode()
           
 java.lang.String getErrorMessage()
           
 java.lang.String getMessage()
          Returns a combined message consisting of the details message passed on the construction and the 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()
Deprecated. Use the LastErrorException(long) instead.

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


LastErrorException

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

Parameters:
errorCode - specifies the last error code.

LastErrorException

public LastErrorException(java.lang.String message)
Deprecated. Use the LastErrorException(long, String) instead.

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. Th system error message for the stored error code should be retrieved by the getErrorMessage() method.

Parameters:
message - the details message.

LastErrorException

public LastErrorException(long errorCode,
                          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. The system error message for the stored error code should be retrieved by the getErrorMessage() method.

Parameters:
errorCode - specifies the last error code.
message - the details message.

LastErrorException

public LastErrorException(java.lang.String message,
                          boolean clearError)
Deprecated. Use the LastErrorException(long, String, boolean) instead.

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. The 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(long errorCode,
                          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. The 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:
errorCode - specifies the last error code.
message - the detailed message.
clearError - if true, the error code is cleared.

LastErrorException

public LastErrorException(java.lang.Throwable cause)
Deprecated. Use the LastErrorException(long, Throwable) instead.

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

Parameters:
cause - the cause saved for later retrieval.

LastErrorException

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

Parameters:
errorCode - specifies the last error code.
cause - the cause saved for later retrieval.

LastErrorException

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

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

getErrorCode

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

getErrorMessage

public java.lang.String getErrorMessage()
Returns:
the 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 the system error message that corresponds to the stored error code. If the details message was not configured, returns an error message. The details and system error messages are separated by the space character.

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