--- substitutions: prop: |- ```{image} ico/prop.ico ``` --- # WebRequestException Class The exception that is thrown when an error occurs while sending a request. **Namespace:** powerGate.Erp.Client\ **Assembly:** powerGate.Erp.Client.dll ## Inheritance Hierarchy [System.Object]()\  [System.Exception]()\   **powerGate.Erp.Client.WebRequestException** ## Syntax ```{code-block} CSharp :linenos: public class WebRequestException : Exception ``` The following members which allow to determine why the Web server response was not successful: ## Properties | Type | Name | Description | |-----------------|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | {{prop}} string | Message | Gets a human-readable message that describes the current exception (Inherited from [System.Exception](https://msdn.microsoft.com/en-us/library/system.exception(v=vs.110).aspx)). | | {{prop}} int | StatusCode | Gets the [HTTP status code](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) of the server response. | | {{prop}} string | RawResponse | Gets the plain message body from the server response. | | {{prop}} object | Response | Gets the error data from the OData response or null for generic HTTP error responses. | ## Remarks Exceptions of this type are thrown by the [ErpClient](erpclient), [ErpEntitySet](ierpentityset) and [MediaResources](imediaresources) when requesting data from the ERP Services. The **Message** property returns the error message from within the OData response (the message of the most *InnerError* is provided, when such data is available in the OData response).\ For generic HTTP error responses a returned [reason phrase](https://en.wikipedia.org/wiki/Hypertext_transfer-Protocol#Response_messages) provides further information about the nature of the problem. The **Response** property provides access to the data within OData error responses (see [OData v3](https://www.odata.org/documentation/odata-version-3-0/json-verbose-format/#representingerrorsinaresponse) and [OData v4](http://docs.oasis-open.org/odata/odata-json-format/v4.01/odata-json-format-v4.01.html#_Toc38457793)): - The property `Message` contains a human-readable representation of the error. - `ErrorCode` returns a service-defined error code which serves as a sub-status for the HTTP *StatusCode*. - `InnerError` data can be available and contains information that will help to debug the service. ## See also **Reference** - [powerGate.Erp.Client namespace](/code_reference/net_library)