com.sap.netweaver.bc.uwl

Class UWLException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.sap.netweaver.bc.uwl.UWLException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ConnectorException, SubstitutionException

public class UWLException
extends Exception

The UWLException class adds "exception chaining" which is available in jdk1.4. The methods printStackTrace, getMessage and getLocalizedMessage are over ridden in order to take care of the possible nested exception. This class extensively uses the error categories and codes specified in ErrorMessages.

See Also:
Serialized Form

Constructor Summary
UWLException(int category, int code)
          This constructor creates the object with the error message associated with the given errocategory and code.
UWLException(int category, int code, String message)
          This constructor calls the constructor of the super class.
UWLException(int category, int code, Throwable original)
           
UWLException(int category, String message)
          This constructor is similar to UWLException(int, int, java.lang.String) except for the fact that error code is considered equal to zero.
UWLException(int category, Throwable original)
          This is one of the constructors that will be useful if the user needs the nested exception feature.
 
Method Summary
 int getCode()
           
 String getLocalizedMessage()
          If the original exception is not null, this method concatenates the localized messages of this exception and the nested exception.
 String getMessage()
          If the original exception is not null, this method concatenates the messages of this exception and the nested exception.
 Throwable getOriginalException()
           
 String getUwlExceptionID()
           
 void printStackTrace()
          If the nested exception is not null, this will print its stack trace first.
 void printStackTrace(PrintStream stream)
          If the nested exception is not null, this will print its stack trace first.
 void printStackTrace(PrintWriter writer)
          If the nested exception is not null, this will print its stack trace first.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UWLException

public UWLException(int category,
                    int code,
                    String message)
This constructor calls the constructor of the super class. With the help of error category and code, from ErrorMessages, it first obtains the basic error message. Then to the above, it concatenates the message passed to it.

Parameters:
category - the error category like database.
code - the error code like NO_URL_SPECIFIED.
message - the additional error message.
See Also:
Exception.Exception(java.lang.String)

UWLException

public UWLException(int category,
                    String message)
This constructor is similar to UWLException(int, int, java.lang.String) except for the fact that error code is considered equal to zero.

Parameters:
category - the error category like database.
message - the additional message.

UWLException

public UWLException(int category,
                    Throwable original)
This is one of the constructors that will be useful if the user needs the nested exception feature.

Parameters:
category - the error category like database.
original - the original exception that needs to be nested.

UWLException

public UWLException(int category,
                    int code,
                    Throwable original)

UWLException

public UWLException(int category,
                    int code)
This constructor creates the object with the error message associated with the given errocategory and code.

Parameters:
category - the error category like database.
code - the error code like NO_URL_SPECIFIED.
See Also:
Exception.Exception(java.lang.String)
Method Detail

getOriginalException

public Throwable getOriginalException()
Returns:
Exception the original exception nested inside this exception. Note this could be null.

printStackTrace

public void printStackTrace()
If the nested exception is not null, this will print its stack trace first. Then, it prints the current stack trace.

Overrides:
printStackTrace in class Throwable
See Also:
Throwable.printStackTrace()

printStackTrace

public void printStackTrace(PrintStream stream)
If the nested exception is not null, this will print its stack trace first. Then, it prints the current stack trace.

Overrides:
printStackTrace in class Throwable
Parameters:
stream - the stream to which this stack trace needs to be printed.
See Also:
Throwable.printStackTrace(java.io.PrintStream)

printStackTrace

public void printStackTrace(PrintWriter writer)
If the nested exception is not null, this will print its stack trace first. Then, it prints the current stack trace.

Overrides:
printStackTrace in class Throwable
Parameters:
writer - the print writer to which this stack trace needs to be printed.
See Also:
Throwable.printStackTrace(java.io.PrintWriter)

getMessage

public String getMessage()
If the original exception is not null, this method concatenates the messages of this exception and the nested exception. Otherwise, it simple calls super.getMessage.

Overrides:
getMessage in class Throwable
Returns:
String the message.
See Also:
Throwable.getMessage()

getLocalizedMessage

public String getLocalizedMessage()
If the original exception is not null, this method concatenates the localized messages of this exception and the nested exception. Otherwise, it simply calls super.getMessage.

Overrides:
getLocalizedMessage in class Throwable
Returns:
String the localized message.
See Also:
Throwable.getLocalizedMessage()

getCode

public int getCode()
Returns:
int the error code.

getUwlExceptionID

public String getUwlExceptionID()
Access Rights

This class can be accessed from:


SC DC Public Part ACH
[sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api - EP-BC-UWL
[sap.com] UWLJWF [sap.com] tc/kmc/bc.uwl/api default EP-BC-UWL


Copyright 2011 SAP AG Complete Copyright Notice