Exception

The Exception Helper gives you the ability to manipulate vCloud SDK exceptions (VMware_VCloud_SDK_Exception) with ease. It allows extracting the error codes and messages from the original exception message, with is just raw XML of the form:

xml <Error xmlns="http://www.vmware.com/vcloud/v1.5" message="xs:string" majorErrorCode="xs:int" minorErrorCode="xs:string" vendorSpecificErrorCode="xs:string" stackTrace="xs:string" />

Methods

Create a new Exception Helper

__construct(\VMware_VCloud_SDK_Exception $originalException) 

Arguments

$originalException

\VMware_VCloud_SDK_Exception

Any exception thrown by VMware VCloud SDK for PHP

Create a new Exception Helper and returns it without modifications. This form allow chaining in ALL versions of PHP:

create(\VMware_VCloud_SDK_Exception $originalException) : \VCloud\Helpers\Exception
static

\VCloud\Helpers\Exception::create($e)->getMessage()

Since PHP 5.4, Class member access on instantiation is allowed:

new (\VCloud\Helpers\Exception($e))->getMessage()

Arguments

$originalException

\VMware_VCloud_SDK_Exception

Any exception thrown by VMware VCloud SDK for PHP

Response

\VCloud\Helpers\Exception

Returns a new Exception Handler

Get the original exception

getOriginalException() : \VMware_VCloud_SDK_Exception

Response

\VMware_VCloud_SDK_Exception

The original exception

Get the error message

getMessage() : string

Response

string

The error message

Get the error major error code

getMajorErrorCode() : string

Response

string

The error major error code

Get the error minor error code

getMinorErrorCode() : string

Response

string

The error minor error code

Get the error stack trace

getStackTrace() : string

Response

string

The error stack trace

Properties

The original exception

originalException : \Exception
var

The original exception

Type(s)

\Exception

The parsed error message

document : \SimpleXMLElement
var

The parsed error message

Type(s)

\SimpleXMLElement