diff --git a/docs/html/classes/amcintosh-FreshBooks-Exception-FreshBooksException.html b/docs/html/classes/amcintosh-FreshBooks-Exception-FreshBooksException.html index dadb929..c4c279f 100644 --- a/docs/html/classes/amcintosh-FreshBooks-Exception-FreshBooksException.html +++ b/docs/html/classes/amcintosh-FreshBooks-Exception-FreshBooksException.html @@ -195,6 +195,13 @@

 : int|null +
+ +
+ $errorDetails + +  : array<string|int, mixed>|null +
@@ -216,6 +223,13 @@

 : int|null

+
+ +
+ getErrorDetails() + +  : array<string|int, mixed>|null +
@@ -270,6 +284,40 @@

+ +
+

+ $errorDetails + + + +

+ + + + + public + array<string|int, mixed>|null + $errorDetails + + +
+ +
+ + +
public - __construct(string $message, int $statusCode[, Throwable $previous = null ][, string $rawResponse = null ][, int $errorCode = null ]) : mixed + __construct(string $message, int $statusCode[, Throwable $previous = null ][, string $rawResponse = null ][, int $errorCode = null ][, array<string|int, mixed> $errorDetails = null ]) : mixed
@@ -377,6 +425,14 @@
Parameters
+
+
+ $errorDetails + : array<string|int, mixed> + = null
+
+
+
@@ -401,7 +457,7 @@

@@ -420,6 +476,39 @@

Return values
— +
+
+

+ getErrorDetails() + +

+ + + + + public + getErrorDetails() : array<string|int, mixed>|null + +
+ + + + +
Return values
+ array<string|int, mixed>|null + — + +
diff --git a/docs/html/classes/amcintosh-FreshBooks-Resource-AccountingResource.html b/docs/html/classes/amcintosh-FreshBooks-Resource-AccountingResource.html index ee9b279..b383ed0 100644 --- a/docs/html/classes/amcintosh-FreshBooks-Resource-AccountingResource.html +++ b/docs/html/classes/amcintosh-FreshBooks-Resource-AccountingResource.html @@ -317,11 +317,18 @@

- createResponseError() + createNewResponseError()  : void
-
Parse the json response from the accounting endpoint and create a FreshBooksException from it.
+
Parse the json response for new-style accounting endpoint errors and create a FreshBooksException from it.
+ +
+ createOldResponseError() + +  : void +
+
Parse the json response for old-style accounting endpoint errors and create a FreshBooksException from it.
getUrl() @@ -330,6 +337,13 @@

The the url to the accounting resource.
+
+ handleError() + +  : void +
+
Create a FreshBooksException from the json response from the accounting endpoint.
+
makeRequest() @@ -815,7 +829,7 @@

@@ -888,7 +902,7 @@

@@ -947,7 +961,7 @@

@@ -1011,7 +1025,7 @@

@@ -1067,7 +1081,7 @@

@@ -1186,9 +1200,72 @@

Return values
-private " > -

- createResponseError() - +

+ createNewResponseError() + +

+ + +

Parse the json response for new-style accounting endpoint errors and create a FreshBooksException from it.

+ + + private + createNewResponseError(int $statusCode, array<string|int, mixed> $responseData, string $rawRespone) : void + + +
Parameters
+
+
+ $statusCode + : int +
+
+

HTTP status code

+
+ +
+
+ $responseData + : array<string|int, mixed> +
+
+

The json-parsed response

+
+ +
+
+ $rawRespone + : string +
+
+

The raw response body

+
+ +
+
+ + + +
Return values
+ void + — + + +

+
+

+ createOldResponseError() +

-

Parse the json response from the accounting endpoint and create a FreshBooksException from it.

+

Parse the json response for old-style accounting endpoint errors and create a FreshBooksException from it.

private - createResponseError(int $statusCode, array<string|int, mixed> $responseData, string $rawRespone) : void + createOldResponseError(int $statusCode, array<string|int, mixed> $responseData, string $rawRespone) : void
Parameters
@@ -1292,6 +1369,69 @@
Return values
— +
+
+

+ handleError() + +

+ + +

Create a FreshBooksException from the json response from the accounting endpoint.

+ + + private + handleError(int $statusCode, array<string|int, mixed> $responseData, string $rawRespone) : void + + +
Parameters
+
+
+ $statusCode + : int +
+
+

HTTP status code

+
+ +
+
+ $responseData + : array<string|int, mixed> +
+
+

The json-parsed response

+
+ +
+
+ $rawRespone + : string +
+
+

The raw response body

+
+ +
+
+ + + +
Return values
+ void + — + +
diff --git a/docs/html/classes/amcintosh-FreshBooks-Resource-ProjectResource.html b/docs/html/classes/amcintosh-FreshBooks-Resource-ProjectResource.html index dfd91f2..6152f16 100644 --- a/docs/html/classes/amcintosh-FreshBooks-Resource-ProjectResource.html +++ b/docs/html/classes/amcintosh-FreshBooks-Resource-ProjectResource.html @@ -309,6 +309,13 @@

+
+ createResponseError() + +  : void +
+
Parse the json response for project endpoint errors and create a FreshBooksException from it.
+
getUrl() @@ -752,7 +759,7 @@

@@ -825,7 +832,7 @@

@@ -882,7 +889,7 @@

@@ -946,7 +953,7 @@

@@ -1002,7 +1009,7 @@

@@ -1114,6 +1121,69 @@

Return values
— + +
+

+ createResponseError() + +

+ + +

Parse the json response for project endpoint errors and create a FreshBooksException from it.

+ + + private + createResponseError(int $statusCode, array<string|int, mixed> $responseData, string $rawRespone) : void + + +
Parameters
+
+
+ $statusCode + : int +
+
+

HTTP status code

+
+ +
+
+ $responseData + : array<string|int, mixed> +
+
+

The json-parsed response

+
+ +
+
+ $rawRespone + : string +
+
+

The raw response body

+
+ +
+
+ + + +
Return values
+ void + — + +
diff --git a/docs/html/js/searchIndex.js b/docs/html/js/searchIndex.js index 5386c34..56811f9 100644 --- a/docs/html/js/searchIndex.js +++ b/docs/html/js/searchIndex.js @@ -205,6 +205,11 @@ Search.appendIndex( "name": "getErrorCode", "summary": "", "url": "classes/amcintosh-FreshBooks-Exception-FreshBooksException.html#method_getErrorCode" + }, { + "fqsen": "\\amcintosh\\FreshBooks\\Exception\\FreshBooksException\u003A\u003AgetErrorDetails\u0028\u0029", + "name": "getErrorDetails", + "summary": "", + "url": "classes/amcintosh-FreshBooks-Exception-FreshBooksException.html#method_getErrorDetails" }, { "fqsen": "\\amcintosh\\FreshBooks\\Exception\\FreshBooksException\u003A\u003A\u0024rawResponse", "name": "rawResponse", @@ -215,6 +220,11 @@ Search.appendIndex( "name": "errorCode", "summary": "", "url": "classes/amcintosh-FreshBooks-Exception-FreshBooksException.html#property_errorCode" + }, { + "fqsen": "\\amcintosh\\FreshBooks\\Exception\\FreshBooksException\u003A\u003A\u0024errorDetails", + "name": "errorDetails", + "summary": "", + "url": "classes/amcintosh-FreshBooks-Exception-FreshBooksException.html#property_errorDetails" }, { "fqsen": "\\amcintosh\\FreshBooks\\Exception\\FreshBooksNotImplementedException", "name": "FreshBooksNotImplementedException", @@ -2616,10 +2626,20 @@ Search.appendIndex( "summary": "Make\u0020a\u0020request\u0020against\u0020the\u0020accounting\u0020resource\u0020and\u0020return\u0020an\u0020array\u0020of\u0020the\u0020json\u0020response.", "url": "classes/amcintosh-FreshBooks-Resource-AccountingResource.html#method_makeRequest" }, { - "fqsen": "\\amcintosh\\FreshBooks\\Resource\\AccountingResource\u003A\u003AcreateResponseError\u0028\u0029", - "name": "createResponseError", - "summary": "Parse\u0020the\u0020json\u0020response\u0020from\u0020the\u0020accounting\u0020endpoint\u0020and\u0020create\u0020a\u0020FreshBooksException\u0020from\u0020it.", - "url": "classes/amcintosh-FreshBooks-Resource-AccountingResource.html#method_createResponseError" + "fqsen": "\\amcintosh\\FreshBooks\\Resource\\AccountingResource\u003A\u003AcreateOldResponseError\u0028\u0029", + "name": "createOldResponseError", + "summary": "Parse\u0020the\u0020json\u0020response\u0020for\u0020old\u002Dstyle\u0020accounting\u0020endpoint\u0020errors\u0020and\u0020create\u0020a\u0020FreshBooksException\u0020from\u0020it.", + "url": "classes/amcintosh-FreshBooks-Resource-AccountingResource.html#method_createOldResponseError" + }, { + "fqsen": "\\amcintosh\\FreshBooks\\Resource\\AccountingResource\u003A\u003AcreateNewResponseError\u0028\u0029", + "name": "createNewResponseError", + "summary": "Parse\u0020the\u0020json\u0020response\u0020for\u0020new\u002Dstyle\u0020accounting\u0020endpoint\u0020errors\u0020and\u0020create\u0020a\u0020FreshBooksException\u0020from\u0020it.", + "url": "classes/amcintosh-FreshBooks-Resource-AccountingResource.html#method_createNewResponseError" + }, { + "fqsen": "\\amcintosh\\FreshBooks\\Resource\\AccountingResource\u003A\u003AhandleError\u0028\u0029", + "name": "handleError", + "summary": "Create\u0020a\u0020FreshBooksException\u0020from\u0020the\u0020json\u0020response\u0020from\u0020the\u0020accounting\u0020endpoint.", + "url": "classes/amcintosh-FreshBooks-Resource-AccountingResource.html#method_handleError" }, { "fqsen": "\\amcintosh\\FreshBooks\\Resource\\AccountingResource\u003A\u003ArejectMissing\u0028\u0029", "name": "rejectMissing", @@ -2765,6 +2785,11 @@ Search.appendIndex( "name": "getUrl", "summary": "The\u0020the\u0020url\u0020to\u0020the\u0020accounting\u0020resource.", "url": "classes/amcintosh-FreshBooks-Resource-ProjectResource.html#method_getUrl" + }, { + "fqsen": "\\amcintosh\\FreshBooks\\Resource\\ProjectResource\u003A\u003AcreateResponseError\u0028\u0029", + "name": "createResponseError", + "summary": "Parse\u0020the\u0020json\u0020response\u0020for\u0020project\u0020endpoint\u0020errors\u0020and\u0020create\u0020a\u0020FreshBooksException\u0020from\u0020it.", + "url": "classes/amcintosh-FreshBooks-Resource-ProjectResource.html#method_createResponseError" }, { "fqsen": "\\amcintosh\\FreshBooks\\Resource\\ProjectResource\u003A\u003AmakeRequest\u0028\u0029", "name": "makeRequest",