org.gcube.common.core.faults
Class FaultUtils

java.lang.Object
  extended by org.gcube.common.core.faults.FaultUtils

public class FaultUtils
extends Object

Utilities to convert between remote faults and local exceptions whilst preserving stack traces.

Author:
Fabio Simeoni

Constructor Summary
FaultUtils()
           
 
Method Summary
static
<E extends GCUBEFault>
E
newFault(E fault, Throwable localCause)
          Returns a given fault after serialising into it an original cause.
static Throwable remoteCause(GCUBEFault fault)
          Returns the remote cause of a Fault as a Throwable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FaultUtils

public FaultUtils()
Method Detail

newFault

public static <E extends GCUBEFault> E newFault(E fault,
                                                Throwable localCause)
Returns a given fault after serialising into it an original cause.

Type Parameters:
E - the type of the fault
Parameters:
fault - the fault
localCause - the cause
Returns:
the fault

remoteCause

public static Throwable remoteCause(GCUBEFault fault)
Returns the remote cause of a Fault as a Throwable

Parameters:
fault - the fault
Returns:
the Throwable


Copyright © 2013. All Rights Reserved.