i-net Clear Reports

com.inet.report
Class ReportException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.inet.report.ReportException
All Implemented Interfaces:
com.inet.viewer.HasErrorCode, java.io.Serializable
Direct Known Subclasses:
FatalParserException, KeyNotFoundException, PageOutOfRangeException, TimeoutException

public class ReportException
extends java.lang.Exception
implements com.inet.viewer.HasErrorCode

This is the base class of the i-net Clear Reports exception hierarchy. This exception is thrown whenever an unrecoverable error occurs within i-net Clear Reports.

See Also:
Serialized Form

Field Summary
 int messageId
          Deprecated. As of i-net Crystal-Clear version 10.0, replaced by getErrorCode()
 java.lang.String msg
          Deprecated. As of i-net Crystal-Clear version 10.0, replaced by Throwable.getMessage()
 
Constructor Summary
ReportException(java.lang.String msg, int errorCode)
          Creates a new report exception.
 
Method Summary
 int getErrorCode()
          Returns an error code that describes the cause for this exception.
 ReportException setCause(java.lang.Throwable cause)
          Sets the cause for this exception.
 java.lang.String toString()
           Returns a string which contains the message id and the message
 

Field Detail

messageId

@Deprecated
public int messageId
Deprecated. As of i-net Crystal-Clear version 10.0, replaced by getErrorCode()
MessageID of the exception (starting at 0). If no number is set, the default error message ID number is 0.


msg

@Deprecated
public java.lang.String msg
Deprecated. As of i-net Crystal-Clear version 10.0, replaced by Throwable.getMessage()
The exception error message text

Constructor Detail

ReportException

public ReportException(java.lang.String msg,
                       int errorCode)
Creates a new report exception.
The message msg is sent to the client viewer with the message number messageId. The message string is not translated in any way and you can use any messageId you want if you follow the convention that the java viewer bean interprets negative messageId's as warnings and positive numbers (>0) as errors. The error/warning message is shown by the java viewer bean in the dialog box.
For example you can use this method in the checkProperties() method to send a message to the client:
 if(prop.getProperty("user", "").equals("peter")) { 
     throw new ReportException("Access denied", 105);
 }

Parameters:
msg - The formatted message
errorCode - An integer you can associate with your message and which will be shown by the client. The java client uses the convention that a id<0 is interpreted as a warning and id>0 as an error message.
Method Detail

toString

public java.lang.String toString()
Returns a string which contains the message id and the message

Overrides:
toString in class java.lang.Throwable
Returns:
String

setCause

public ReportException setCause(java.lang.Throwable cause)
Sets the cause for this exception.

Parameters:
cause - The cause is the throwable that caused this ReportException to get thrown.
Returns:
a reference to itself.

getErrorCode

public int getErrorCode()
Returns an error code that describes the cause for this exception.

Returns:
An error code that describes the cause for this exception.

i-net Clear Reports

Copyright © 1999-2015 by i-net software GmbH