/** * @return never returns. */ public static InternalServerErrorServiceException internalServerError(@NotNull String message) throws BadRequestServiceException { throw new InternalServerErrorServiceException( RestFaultInfoBuilder.faultInfo( FaultInfos.Server.InternalServerError.internalServerError(message), Response.Status.INTERNAL_SERVER_ERROR ) ); }
|| t instanceof UnsupportedOperationException || t instanceof AssertionError) { throw new InternalServerErrorServiceException( FaultInfos.Server.InternalServerError.internalServerError(message) ); ); } else {//includes RuntimeException, Exception, Error, Throwable: throw new InternalServerErrorServiceException( FaultInfos.Server.InternalServerError.internalServerError(message) );
@NotNull @Override public Exception translate(@NotNull Throwable t) throws Exception { SoapFaultInfo faultInfo = extractFaultInfo(t); switch (faultInfo.getFaultCause()) { case "BadRequest": throw new BadRequestServiceException(faultInfo); case "AccessDenied": throw new AccessDeniedServiceException(faultInfo); case "Protocol": throw new ProtocolServiceException(faultInfo); case "InternalServerError": throw new InternalServerErrorServiceException(faultInfo); case "ServiceTemporarilyUnavailable": throw new ServiceTemporarilyUnavailableServiceException(faultInfo); case "BadResponse": throw new BadResponseServiceException(faultInfo); default: throw new UnsupportedOperationException("Unhandled case: "+faultInfo.getFaultCause()+"!"); } }
return new InternalServerErrorServiceException(faultInfo); case "ServiceTemporarilyUnavailable": return new ServiceTemporarilyUnavailableServiceException(faultInfo);
throw new AccessDeniedServiceException(faultInfo); case "InternalServerError": throw new InternalServerErrorServiceException(faultInfo); case "ServiceTemporarilyUnavailable": throw new ServiceTemporarilyUnavailableServiceException(faultInfo);