--- myst: substitutions: prop: |- ```{image} /img/code_reference/net_library/prop.ico ``` ms_exception_link: |- [System.Exception]() --- # 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]()\  {{ms_exception_link}}\   **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 {{ms_exception_link}}). | | {{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. | | {{prop}} int | StatusCode | Gets the [HTTP status code]() of the server response. | | {{prop}} string | Source | Indicates in which part of the ERP integration the error was caused (by the *"Local computer"*, *"powerGateServer"* or the "*ERP system*"). (Inherited from {{ms_exception_link}}). | | {{prop}} string | StackTrace | Gets a string representation of the immediate frames on the call stack (provided by the powerGateServer Plugin or Erp system). (Inherited from {{ms_exception_link}}). | ## Remarks Exceptions of this type are thrown by the [ErpClient](), [ErpEntitySet]() and [MediaResources]() 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]() provides further information about the nature of the problem. The **Response** property provides access to the data within OData error responses (see [OData v3]() and [OData v4]()): - 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]()