public static StaleKbObjectException fromThrowable ( String message , Throwable cause ) { return ( cause instanceof StaleKbObjectException && Objects . equals ( message , cause . getMessage ( ) ) ) ? ( StaleKbObjectException ) cause : new StaleKbObjectException ( message , cause ) ; }
Converts a Throwable to a StaleKbObjectException with the specified detail message . If the Throwable is a StaleKbObjectException 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 StaleKbObjectException with the detail message .