public static CreateException fromThrowable ( String message , Throwable cause ) { return ( cause instanceof CreateException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( CreateException ) cause : new CreateException ( message , cause ) ; }
Converts a Throwable to a CreateException with the specified detail message . If the Throwable is a CreateException and if the Throwable s message is identical to the one supplied the Throwable will be passed through unmodified ; otherwise it will be wrapped in a new CreateException with the detail message .