be.SIRAPRISE.client
Class ErrorMessageException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by be.SIRAPRISE.client.ErrorMessageException
All Implemented Interfaces:
java.io.Serializable

public class ErrorMessageException
extends java.lang.Exception

An ErrorMessageException is thrown to indicate that a received message is (presumably) not the expected type of message, but an error message instead. That way, the java Exceptions mechanism can be used to isolate exception processing in a SIRA_PRISE client for exceptions signaled by a SIRA_PRISE server, instead of having to code 'instanceof ErrorMessageType' in each and every client. The getMessage() method of this Exception will return a string structured as 'errortype:errornum:errortext', in which errortext is the original error message sent out by the server, and errortype:errornum can be as follows :

Errortype Errortype description Meaning of ErrorNum
201806116 Error indicates a constraint violation The numeric Id of the constraint that was violated
858993459 Error indicates a runtime error none, value always -1
1497858657 Error indicates a sira_prise runtime error The numeric Id of the runtime error

Author:
Erwin Smout
See Also:
Serialized Form

Constructor Summary
ErrorMessageException(ServerErrorMessage serverErrorMessage)
          Creates the exception, setting the server error message that caused this exception to be thrown.
 
Method Summary
 ServerErrorMessage getServerErrorMessage()
          Gets The error message that was read instead of the (presumably) expected one.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ErrorMessageException

public ErrorMessageException(ServerErrorMessage serverErrorMessage)
Creates the exception, setting the server error message that caused this exception to be thrown.

Parameters:
serverErrorMessage - The error message that was read instead of the (presumably) expected one.
Method Detail

getServerErrorMessage

public ServerErrorMessage getServerErrorMessage()
Gets The error message that was read instead of the (presumably) expected one.

Returns:
The error message that was read instead of the (presumably) expected one.