com.businessobjects.customds.exception
Class DataSourceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.businessobjects.customds.exception.DataSourceException
All Implemented Interfaces:
java.io.Serializable

public class DataSourceException
extends java.lang.Exception

DataSourceException is an exception class that the framework and plug-in use for all the handled exceptions.

This facilitates to control the error messages that are presented to the user.

The major code must be one of the codes mentioned in ErrorCodes with "MAJOR_" as the prefix.

The minor code must be one of the codes mentioned in ErrorCodes with "MINOR_" as the prefix.

Note: The messages in DataSourceException, which are thrown by the Framework, are not localized. These messages are used only for logging purpose. However, messages apart from custom messages are localized internally before presenting it to the user. So, if plug-in throws an exception with minorCode as ErrorCodes.MINOR_CUSTOM, it is plug-in's responsibility to pass on the localized message which will be presented to the user.

As a good practice, Major code should reflect the point where the exception was encountered - e.g. MAJOR_GET_INFO_ERROR for errors during call to init method, MAJOR_GET_STRUCTURE_ERROR for errors during call to getColumnsInfo method etc.

Since:
12.2
See Also:
Serialized Form

Constructor Summary
DataSourceException(java.lang.String msg, int majorCode, int minorCode)
          Class Constructor
DataSourceException(java.lang.Throwable t, java.lang.String msg, int majorCode, int minorCode)
          Class Constructor
 
Method Summary
 java.lang.Throwable getCause()
          Returns the cause of the DataSourceException or null, if the cause is unknown.
 java.lang.Throwable getException()
          Returns the DataSourceException as a Throwable object.
 int getMajorCode()
          Internal Use Only
 java.lang.String getMessage()
          Internal Use Only
 java.lang.String getMessage(boolean withStack)
          Internal Use Only
 int getMinorCode()
          Internal Use Only
 java.lang.String getStackTraceAsString()
          Internal Use Only
 java.lang.String toString()
          Internal Use Only
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataSourceException

public DataSourceException(java.lang.String msg,
                           int majorCode,
                           int minorCode)
Class Constructor

Parameters:
msg - The exception message.
majorCode - The major code for DataSourceException.
minorCode - The minor code for DataSourceException.

DataSourceException

public DataSourceException(java.lang.Throwable t,
                           java.lang.String msg,
                           int majorCode,
                           int minorCode)
Class Constructor

Parameters:
t - The java.lang.Throwable object for obtaining the stack trace.
msg - The exception message.
majorCode - The major code for DataSourceException.
minorCode - The minor code for DataSourceException.
Method Detail

getException

public java.lang.Throwable getException()
Returns the DataSourceException as a Throwable object.

This method facilitates the retrieval of the Throwable object that was used to create DataSourceException.

Returns:
The Throwable object that was used to create the DataSourceException object, or DataSourceException as a Throwable object.

getCause

public java.lang.Throwable getCause()
Returns the cause of the DataSourceException or null, if the cause is unknown. This method returns the cause that was supplied either by using one of the constructor with a Throwable object, or by the initCause(Throwable) method.

Overrides:
getCause in class java.lang.Throwable
Returns:
The cause of DataSourceException or null, if the cause is unknown.

getMessage

public java.lang.String getMessage(boolean withStack)
Internal Use Only


getMessage

public java.lang.String getMessage()
Internal Use Only

Overrides:
getMessage in class java.lang.Throwable
See Also:
Throwable.getMessage()

getMinorCode

public int getMinorCode()
Internal Use Only


getMajorCode

public int getMajorCode()
Internal Use Only


toString

public java.lang.String toString()
Internal Use Only

Overrides:
toString in class java.lang.Throwable

getStackTraceAsString

public java.lang.String getStackTraceAsString()
Internal Use Only