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

1
public class WebRequestException : Exception

The following members which allow to determine why the Web server response was not successful:

Properties

Type

Name

Description

../../../_images/prop.ico string

Message

Gets a human-readable message that describes the current exception (Inherited from System.Exception).

../../../_images/prop.ico string

RawResponse

Gets the plain message body from the server response.

../../../_images/prop.ico object

Response

Gets the error data from the OData response or null for generic HTTP error responses.

../../../_images/prop.ico int

StatusCode

Gets the HTTP status code of the server response.

../../../_images/prop.ico 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 System.Exception).

../../../_images/prop.ico string

StackTrace

Gets a string representation of the immediate frames on the call stack (provided by the powerGateServer Plugin or Erp system). (Inherited from System.Exception).

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