private static HttpStatusCode GetHttpStatusCodeFromProxyWebRequestProcessingException(ProxyWebRequestProcessingException e) { if (e == null) { return(HttpStatusCode.InternalServerError); } if (e.InnerException is WebException) { return(UserPhotoQueryResult.GetHttpStatusCodeFromWebException((WebException)e.InnerException)); } if (e.InnerException is AddressSpaceNotFoundException) { return(HttpStatusCode.NotFound); } return(HttpStatusCode.InternalServerError); }
private static HttpStatusCode TranslateExceptionToHttpStatusCode(Exception e) { if (e == null) { return(HttpStatusCode.InternalServerError); } if (e is UserPhotoNotFoundException) { return(HttpStatusCode.NotFound); } if (e is MailRecipientNotFoundException) { return(HttpStatusCode.NotFound); } if (e is ProxyServerWithMinimumRequiredVersionNotFound) { return(HttpStatusCode.NotFound); } if (e is AccessDeniedException) { return(HttpStatusCode.Forbidden); } if (e is NoFreeBusyAccessException) { return(HttpStatusCode.Forbidden); } if (e is WebException) { return(UserPhotoQueryResult.GetHttpStatusCodeFromWebException((WebException)e)); } if (e is ProxyWebRequestProcessingException) { return(UserPhotoQueryResult.GetHttpStatusCodeFromProxyWebRequestProcessingException((ProxyWebRequestProcessingException)e)); } return(HttpStatusCode.InternalServerError); }