Class FailureConverter


  • public class FailureConverter
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JAVA_SDK  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.temporal.api.failure.v1.Failure exceptionToFailure​(java.lang.Throwable e)  
      static io.temporal.api.failure.v1.Failure exceptionToFailure​(java.lang.Throwable e, DataConverter dataConverter)
      This method is needed when we need to serialize an exception having a TemporalFailure instance in the chain with details field and no data converter attached explicitly during creation.
      static java.lang.RuntimeException failureToException​(io.temporal.api.failure.v1.Failure failure, DataConverter dataConverter)  
      static boolean isCanceledCause​(java.lang.Throwable exception)  
      static java.lang.StackTraceElement[] parseStackTrace​(java.lang.String stackTrace)
      Parses stack trace serialized using serializeStackTrace(Throwable).
      static java.lang.String serializeStackTrace​(java.lang.Throwable e)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FailureConverter

        public FailureConverter()
    • Method Detail

      • failureToException

        public static java.lang.RuntimeException failureToException​(io.temporal.api.failure.v1.Failure failure,
                                                                    DataConverter dataConverter)
        Parameters:
        failure - TemporalFailure proto to deserialize into an exception
        dataConverter - to be used to convert Failure#failure_info#details if present which contain additional user supplied details.
        Returns:
        deserialized exception
      • exceptionToFailure

        public static io.temporal.api.failure.v1.Failure exceptionToFailure​(java.lang.Throwable e,
                                                                            DataConverter dataConverter)
        This method is needed when we need to serialize an exception having a TemporalFailure instance in the chain with details field and no data converter attached explicitly during creation.
      • exceptionToFailure

        public static io.temporal.api.failure.v1.Failure exceptionToFailure​(java.lang.Throwable e)
      • parseStackTrace

        public static java.lang.StackTraceElement[] parseStackTrace​(java.lang.String stackTrace)
        Parses stack trace serialized using serializeStackTrace(Throwable).
      • serializeStackTrace

        public static java.lang.String serializeStackTrace​(java.lang.Throwable e)
      • isCanceledCause

        public static boolean isCanceledCause​(java.lang.Throwable exception)