Package edu.isi.pegasus.planner.catalog
Class CatalogException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- edu.isi.pegasus.planner.catalog.CatalogException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ReplicaCatalogException
,SiteCatalogException
,WorkCatalogException
public class CatalogException extends java.lang.RuntimeException
Class to notify of failures. Exceptions are chained like theSQLException
interface.Here is a fragment of code to chain exceptions for later throwing:
CatalogException rce = null; ... some loop code ... { ... if ( exception triggered ) { if ( rce == null ) rce = new CatalogException( reason ); else rce.setNextException( new CatalogException(reason) ); ... } ... loop end ... if ( rce != null ) throw rce;
Here is a fragment of code to unchain exceptions in the client:try { ... operation ... } catch ( CatalogException rce ) { for ( ; rce != null; rce = rce.getNextException ) { ... do something with the payload ... } }
- Author:
- Karan Vahi, Jens-S. Vöckler
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private CatalogException
m_next_exception
chains the next exception into line.
-
Constructor Summary
Constructors Constructor Description CatalogException()
CatalogException(java.lang.String s)
Constructs aCatalogException
with the specified detailed message.CatalogException(java.lang.String s, java.lang.Throwable cause)
Constructs aCatalogException
with the specified detailed message and a cause.CatalogException(java.lang.Throwable cause)
Constructs aCatalogException
with the specified just a cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CatalogException
getNextException()
Retrieves the exception chained to thisCatalogException
object.void
setNextException(CatalogException ex)
Adds anCatalogException
object to the end of the chain.
-
-
-
Field Detail
-
m_next_exception
private CatalogException m_next_exception
chains the next exception into line.
-
-
Constructor Detail
-
CatalogException
public CatalogException()
-
CatalogException
public CatalogException(java.lang.String s)
Constructs aCatalogException
with the specified detailed message.- Parameters:
s
- is the detailled message.
-
CatalogException
public CatalogException(java.lang.String s, java.lang.Throwable cause)
Constructs aCatalogException
with the specified detailed message and a cause.- Parameters:
s
- is the detailled message.cause
- is the cause (which is saved for later retrieval by theThrowable.getCause()
method). Anull
value is permitted, and indicates that the cause is nonexistent or unknown.
-
CatalogException
public CatalogException(java.lang.Throwable cause)
Constructs aCatalogException
with the specified just a cause.- Parameters:
cause
- is the cause (which is saved for later retrieval by theThrowable.getCause()
method). Anull
value is permitted, and indicates that the cause is nonexistent or unknown.
-
-
Method Detail
-
getNextException
public CatalogException getNextException()
Retrieves the exception chained to thisCatalogException
object.- Returns:
- the next
CatalogException
object in the chain;null
if there are none. - See Also:
setNextException( CatalogException )
-
setNextException
public void setNextException(CatalogException ex)
Adds anCatalogException
object to the end of the chain.
- Parameters:
ex
- the new exception that will be added to the end of theCatalogException
chain.- See Also:
getNextException()
-
-