/// <summary> /// Throw an <see cref="MsalUiRequiredException" /> /// </summary> public static Exception GetUiRequiredException( string errorCode, string errorMessage, Exception innerException, ExceptionDetail exceptionDetail) { ValidateRequiredArgs(errorCode, errorMessage); return(new MsalUiRequiredException(errorCode, errorMessage, innerException) { Claims = exceptionDetail?.Claims, ResponseBody = exceptionDetail?.ResponseBody, StatusCode = exceptionDetail?.StatusCode ?? 0 }); }
/// <summary> /// Throws an <see cref="MsalClientException" /> exception /// </summary> /// <param name="errorCode">The error code</param> /// <param name="errorMessage">A user friendly message</param> /// <param name="exceptionDetail">More exception params</param> public static Exception GetServiceException(string errorCode, string errorMessage, ExceptionDetail exceptionDetail) { ValidateRequiredArgs(errorCode, errorMessage); return(GetServiceException(errorCode, errorMessage, null, exceptionDetail)); }
/// <summary> /// Throws an <see cref="MsalClientException" /> exception /// </summary> /// <param name="errorCode">The error code</param> /// <param name="errorMessage">A user friendly message</param> /// <param name="httpResponse"></param> public static Exception GetServiceException(string errorCode, string errorMessage, IHttpWebResponse httpResponse) { ValidateRequiredArgs(errorCode, errorMessage); return(GetServiceException(errorCode, errorMessage, null, ExceptionDetail.FromHttpResponse(httpResponse))); }