@Override public String toString() { return getStatusCode()+" : "+getMessage(); }
if ( sc >= 300 && sc <= 399 ) { FmtLog.info(LOG, "Send patch %s HTTP %d", idStr, sc); throw new DeltaHttpException(sc, "HTTP Redirect"); throw new DeltaHttpException(sc, r.getStatusLine().getReasonPhrase()); if ( sc >= 500 ) throw new DeltaHttpException(sc, r.getStatusLine().getReasonPhrase()); break;
/** Convert to original exception. */ public static DeltaHttpException extract(DeltaHttpException ex) { int statusCode = ex.getStatusCode(); String msg = ex.getMessage(); switch(statusCode) { case HttpSC.BAD_REQUEST_400: return new DeltaBadRequestException(msg); case HttpSC.NOT_FOUND_404: return new DeltaNotFoundException(msg); case HttpSC.UNAUTHORIZED_401: return new DeltaNotRegisteredException(msg); case HttpSC.FORBIDDEN_403: default: return ex; } }