public static InvalidNameException fromThrowable ( Throwable cause ) { return ( cause instanceof InvalidNameException ) ? ( InvalidNameException ) cause : new InvalidNameException ( cause ) ; }
Converts a Throwable to a InvalidNameException . If the Throwable is a InvalidNameException it will be passed through unmodified ; otherwise it will be wrapped in a new InvalidNameException .