conductor-node 9.1.0 → 9.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/dist/package.json +1 -1
- package/dist/src/error.d.ts +11 -11
- package/dist/src/error.js +11 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,14 +160,14 @@ const accountAddInput: QbdTypes.AccountAdd = {
|
|
|
160
160
|
|
|
161
161
|
### `ConductorError`
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
All errors thrown by the Conductor API are instances of `ConductorError` or its subclasses. These errors have the following properties:
|
|
164
164
|
|
|
165
165
|
| Property | Type | Description |
|
|
166
166
|
| ----------------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
167
|
-
| `type` | `string` |
|
|
168
|
-
| `code` | `string` | The unique error code from Conductor, which is useful for adding special handling for specific errors. E.g., `"INTEGRATION_CONNECTION_MISSING"`, `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.<br><br>
|
|
167
|
+
| `type` | `string` | Categorizes the error. See [Error Types](#error-types) below.<br><br>This value is the same as the subclass name. E.g., `"ConductorIntegrationError"` or `"ConductorInvalidRequestError"`. |
|
|
168
|
+
| `code` | `string` | The unique error code from Conductor, which is useful for adding special handling for specific errors. E.g., `"INTEGRATION_CONNECTION_MISSING"`, `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.<br><br>In contrast, `type` is more general and categorizes the error. |
|
|
169
169
|
| `message` | `string` | The developer-friendly error message for your logs. |
|
|
170
|
-
| `endUserMessage` | `string` | The end-user-friendly error message to display in your app's UI
|
|
170
|
+
| `endUserMessage` | `string` | The end-user-friendly error message to display in your app's UI to your end-users.<br><br>This value exists for _every_ error. E.g., for a QBD connection error, it might recommend the end-user to check that their QuickBooks Desktop is open and that they're logged in. But if a Conductor API key is expired, e.g., this message will just say "An internal server error occurred. Please try again later.". |
|
|
171
171
|
| `integrationCode` | `string` or `undefined` | The unique error code supplied by the third-party integration for errors returned by the integration (i.e., `ConductorIntegrationError`) or integration connector (i.e., `ConductorIntegrationConnectorError`). This is useful for adding special handling for specific errors from the third-party integration or connector.<br><br>The integration's corresponding error message for this code is in `error.message`.<br><br>The third-party integrations' error codes are not standardized, so you should not rely on this code to be the same across integrations. |
|
|
172
172
|
| `httpStatusCode` | `number` or `undefined` | The HTTP status code of the response that included the error. You probably won't need this. |
|
|
173
173
|
|
|
@@ -175,14 +175,14 @@ Any error ever thrown by the Conductor API will be an instance of `ConductorErro
|
|
|
175
175
|
|
|
176
176
|
The error object you receive will have one of the following error types:
|
|
177
177
|
|
|
178
|
-
| Type | Description
|
|
179
|
-
| ------------------------------------- |
|
|
180
|
-
| `ConductorIntegrationError` | Raised when the third-party integration returned an error while processing your end-user's request.
|
|
181
|
-
| `ConductorIntegrationConnectionError` | Raised when an error occurred connecting to the third-party integration on behalf of the end-user. Most likely, something is wrong with the end-user's connection or configuration that _the end-user must fix_, not you. <br><br>E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop on the end-user's computer.<br><br>See `error.integrationCode` (above) for the error code that the integration connector returned, if any.<br><br>❗ We recommend _not_ alerting your team for these errors because only the end-user can fix them. See [Global Error Handling](#global-error-handling) for an example of this. |
|
|
182
|
-
| `ConductorInvalidRequestError` | Raised when you make an API call with the wrong parameters, in the wrong state, or in an invalid way.
|
|
183
|
-
| `ConductorAuthenticationError` | Raised when Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key.
|
|
184
|
-
| `ConductorConnectionError` | Raised when there was a network problem between the client (on your server) and Conductor's servers. E.g., a downed network or a bad TLS certificate.
|
|
185
|
-
| `ConductorInternalError` | Raised when something went wrong on Conductor's end. (These are rare.)
|
|
178
|
+
| Type | Description |
|
|
179
|
+
| ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `ConductorIntegrationError` | Raised when the third-party integration returned an error while processing your end-user's request. This is likely due to an issue with your request or data handling that you must fix.<br><br>E.g., a `ListID` you provided was not found in QuickBooks Desktop, or an accounting value you provided failed the integration's accounting rules.<br><br>See `error.integrationCode` (above) for the error code that the integration returned, if any. |
|
|
181
|
+
| `ConductorIntegrationConnectionError` | Raised when an error occurred connecting to the third-party integration on behalf of the end-user. Most likely, something is wrong with the end-user's integration connection or configuration that _the end-user must fix_, not you. <br><br>E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop on the end-user's computer.<br><br>See `error.integrationCode` (above) for the error code that the integration connector returned, if any.<br><br>❗ We recommend _not_ alerting your team for these errors because only the end-user can fix them. See [Global Error Handling](#global-error-handling) for an example of this. |
|
|
182
|
+
| `ConductorInvalidRequestError` | Raised when you make an API call with the wrong parameters, in the wrong state, or in an invalid way. |
|
|
183
|
+
| `ConductorAuthenticationError` | Raised when Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key. |
|
|
184
|
+
| `ConductorConnectionError` | Raised when there was a network problem between the client (on your server) and Conductor's servers. E.g., a downed network or a bad TLS certificate. |
|
|
185
|
+
| `ConductorInternalError` | Raised when something went wrong on Conductor's end. (These are rare.) |
|
|
186
186
|
|
|
187
187
|
### Specific Error Handling
|
|
188
188
|
|
package/dist/package.json
CHANGED
package/dist/src/error.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface ConductorGraphqlError {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare class ConductorError extends Error {
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Categorizes the error.
|
|
24
24
|
*
|
|
25
25
|
* This value is the same as the subclass name. E.g.,
|
|
26
26
|
* `"ConductorIntegrationError"` or `"ConductorInvalidRequestError"`.
|
|
@@ -31,7 +31,7 @@ export declare class ConductorError extends Error {
|
|
|
31
31
|
* handling for specific errors. E.g., `"INTEGRATION_CONNECTION_MISSING"`,
|
|
32
32
|
* `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.
|
|
33
33
|
*
|
|
34
|
-
*
|
|
34
|
+
* In contrast, `type` is more general and categorizes the error.
|
|
35
35
|
*/
|
|
36
36
|
readonly code: string;
|
|
37
37
|
/**
|
|
@@ -39,14 +39,14 @@ export declare class ConductorError extends Error {
|
|
|
39
39
|
*/
|
|
40
40
|
readonly message: string;
|
|
41
41
|
/**
|
|
42
|
-
* The end-user-friendly error message to display in your app's UI
|
|
43
|
-
* end-
|
|
42
|
+
* The end-user-friendly error message to display in your app's UI to your
|
|
43
|
+
* end-users.
|
|
44
44
|
*
|
|
45
|
-
* This value exists for *every* error. E.g.,
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
45
|
+
* This value exists for *every* error. E.g., for a QBD connection error, it
|
|
46
|
+
* might recommend the end-user to check that their QuickBooks Desktop is open
|
|
47
|
+
* and that they're logged in. But if a Conductor API key is expired, e.g.,
|
|
48
|
+
* this message will just say "An internal server error occurred. Please try
|
|
49
|
+
* again later.".
|
|
50
50
|
*/
|
|
51
51
|
readonly endUserMessage: string;
|
|
52
52
|
/**
|
|
@@ -77,7 +77,7 @@ export declare class ConductorError extends Error {
|
|
|
77
77
|
type ConductorErrorOptionsWithoutType = Omit<ConductorErrorOptions, "type">;
|
|
78
78
|
/**
|
|
79
79
|
* Raised when the third-party integration returned an error while processing
|
|
80
|
-
* your end-user's request.
|
|
80
|
+
* your end-user's request. This is likely due to an issue with your request or
|
|
81
81
|
* data handling that you must fix.
|
|
82
82
|
*
|
|
83
83
|
* E.g., a `ListID` you provided was not found in QuickBooks Desktop, or an
|
|
@@ -93,7 +93,7 @@ export declare class ConductorIntegrationError extends ConductorError {
|
|
|
93
93
|
/**
|
|
94
94
|
* Raised when an error occurred connecting to the third-party integration on
|
|
95
95
|
* behalf of the end-user. Most likely, something is wrong with the end-user's
|
|
96
|
-
* connection or configuration that the end-user must fix, not you.
|
|
96
|
+
* integration connection or configuration that the end-user must fix, not you.
|
|
97
97
|
*
|
|
98
98
|
* E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop
|
|
99
99
|
* on the end-user's computer.
|
package/dist/src/error.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.DEFAULT_END_USER_MESSAGE = "An internal server error occurred. Please tr
|
|
|
10
10
|
*/
|
|
11
11
|
class ConductorError extends Error {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Categorizes the error.
|
|
14
14
|
*
|
|
15
15
|
* This value is the same as the subclass name. E.g.,
|
|
16
16
|
* `"ConductorIntegrationError"` or `"ConductorInvalidRequestError"`.
|
|
@@ -21,7 +21,7 @@ class ConductorError extends Error {
|
|
|
21
21
|
* handling for specific errors. E.g., `"INTEGRATION_CONNECTION_MISSING"`,
|
|
22
22
|
* `"API_KEY_INVALID"`, or `"QBD_REQUEST_ERROR"`.
|
|
23
23
|
*
|
|
24
|
-
*
|
|
24
|
+
* In contrast, `type` is more general and categorizes the error.
|
|
25
25
|
*/
|
|
26
26
|
code;
|
|
27
27
|
/**
|
|
@@ -29,14 +29,14 @@ class ConductorError extends Error {
|
|
|
29
29
|
*/
|
|
30
30
|
message;
|
|
31
31
|
/**
|
|
32
|
-
* The end-user-friendly error message to display in your app's UI
|
|
33
|
-
* end-
|
|
32
|
+
* The end-user-friendly error message to display in your app's UI to your
|
|
33
|
+
* end-users.
|
|
34
34
|
*
|
|
35
|
-
* This value exists for *every* error. E.g.,
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* This value exists for *every* error. E.g., for a QBD connection error, it
|
|
36
|
+
* might recommend the end-user to check that their QuickBooks Desktop is open
|
|
37
|
+
* and that they're logged in. But if a Conductor API key is expired, e.g.,
|
|
38
|
+
* this message will just say "An internal server error occurred. Please try
|
|
39
|
+
* again later.".
|
|
40
40
|
*/
|
|
41
41
|
endUserMessage;
|
|
42
42
|
/**
|
|
@@ -85,7 +85,7 @@ class ConductorError extends Error {
|
|
|
85
85
|
exports.ConductorError = ConductorError;
|
|
86
86
|
/**
|
|
87
87
|
* Raised when the third-party integration returned an error while processing
|
|
88
|
-
* your end-user's request.
|
|
88
|
+
* your end-user's request. This is likely due to an issue with your request or
|
|
89
89
|
* data handling that you must fix.
|
|
90
90
|
*
|
|
91
91
|
* E.g., a `ListID` you provided was not found in QuickBooks Desktop, or an
|
|
@@ -104,7 +104,7 @@ exports.ConductorIntegrationError = ConductorIntegrationError;
|
|
|
104
104
|
/**
|
|
105
105
|
* Raised when an error occurred connecting to the third-party integration on
|
|
106
106
|
* behalf of the end-user. Most likely, something is wrong with the end-user's
|
|
107
|
-
* connection or configuration that the end-user must fix, not you.
|
|
107
|
+
* integration connection or configuration that the end-user must fix, not you.
|
|
108
108
|
*
|
|
109
109
|
* E.g., QuickBooks Web Connector (QBWC) failed to connect to QuickBooks Desktop
|
|
110
110
|
* on the end-user's computer.
|
package/package.json
CHANGED