conductor-node 8.5.0 → 8.5.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 +18 -10
- package/dist/package.json +1 -1
- package/dist/src/errors.d.ts +2 -2
- package/dist/src/errors.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -167,7 +167,7 @@ The `ConductorError` and its subclasses have the following properties:
|
|
|
167
167
|
// The unique error code. This is useful for adding special handling
|
|
168
168
|
// for specific errors.
|
|
169
169
|
code: string;
|
|
170
|
-
// The error message for your logs.
|
|
170
|
+
// The developer error message for your logs.
|
|
171
171
|
message: string;
|
|
172
172
|
// The end-user-friendly error message to display in your app.
|
|
173
173
|
endUserMessage: string;
|
|
@@ -184,13 +184,13 @@ The `ConductorError` and its subclasses have the following properties:
|
|
|
184
184
|
|
|
185
185
|
The error object you receive will have one of the following error types:
|
|
186
186
|
|
|
187
|
-
| Type | Description
|
|
188
|
-
| ------------------------------ |
|
|
189
|
-
| `ConductorIntegrationError` | An error occurred on the third-party integration's end while processing your end-user's request. |
|
|
190
|
-
| `ConductorInvalidRequestError` | You made an API call with the wrong parameters, in the wrong state, or in an invalid way.
|
|
191
|
-
| `ConductorAuthenticationError` | Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key.
|
|
192
|
-
| `ConductorConnectionError` | There was a network problem between the client (on your server) and Conductor's servers.
|
|
193
|
-
| `ConductorInternalError` | Something went wrong on Conductor's end. (These are rare.)
|
|
187
|
+
| Type | Description |
|
|
188
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
189
|
+
| `ConductorIntegrationError` | An error occurred on the third-party integration's end while processing your end-user's request. E.g., cannot connect to QuickBooks Desktop on your end-user's computer. |
|
|
190
|
+
| `ConductorInvalidRequestError` | You made an API call with the wrong parameters, in the wrong state, or in an invalid way. |
|
|
191
|
+
| `ConductorAuthenticationError` | Conductor cannot authenticate you with the credentials you provided. E.g., an incorrect API key. |
|
|
192
|
+
| `ConductorConnectionError` | There was a network problem between the client (on your server) and Conductor's servers. |
|
|
193
|
+
| `ConductorInternalError` | Something went wrong on Conductor's end. (These are rare.) |
|
|
194
194
|
|
|
195
195
|
### Example
|
|
196
196
|
|
|
@@ -205,7 +205,14 @@ try {
|
|
|
205
205
|
});
|
|
206
206
|
} catch (error) {
|
|
207
207
|
if (error instanceof ConductorError) {
|
|
208
|
-
// Update your app's UI to display `error.endUserMessage`.
|
|
208
|
+
// TODO: Update your app's UI to display `error.endUserMessage`.
|
|
209
|
+
|
|
210
|
+
// RECOMMENDED: Send a *warning* to Sentry for integration-errors, which are
|
|
211
|
+
// your end-user's fault (e.g., cannot connect to QBD on your end-user's
|
|
212
|
+
// computer) or an *error* for other errors (e.g., invalid API key).
|
|
213
|
+
Sentry.captureException(error, {
|
|
214
|
+
level: error instanceof ConductorIntegrationError ? "warning" : "error",
|
|
215
|
+
});
|
|
209
216
|
}
|
|
210
217
|
// ...
|
|
211
218
|
}
|
|
@@ -225,7 +232,8 @@ conductor.qbd.account
|
|
|
225
232
|
})
|
|
226
233
|
.catch((error) => {
|
|
227
234
|
if (error instanceof ConductorError) {
|
|
228
|
-
// Update your app's UI to display `error.endUserMessage`.
|
|
235
|
+
// TODO: Update your app's UI to display `error.endUserMessage`.
|
|
236
|
+
// ...
|
|
229
237
|
}
|
|
230
238
|
// ...
|
|
231
239
|
});
|
package/dist/package.json
CHANGED
package/dist/src/errors.d.ts
CHANGED
|
@@ -52,8 +52,8 @@ export declare class ConductorError extends Error {
|
|
|
52
52
|
type ConductorErrorOptionsWithoutRawType = Omit<ConductorErrorOptions, "rawType">;
|
|
53
53
|
/**
|
|
54
54
|
* Raised when an error occurs on the third-party integration's end while
|
|
55
|
-
* processing your end-user's request. E.g.,
|
|
56
|
-
*
|
|
55
|
+
* processing your end-user's request. E.g., cannot connect to QuickBooks
|
|
56
|
+
* Desktop on the end-user's computer.
|
|
57
57
|
*/
|
|
58
58
|
export declare class ConductorIntegrationError extends ConductorError {
|
|
59
59
|
static readonly rawType: string;
|
package/dist/src/errors.js
CHANGED
|
@@ -66,8 +66,8 @@ class ConductorError extends Error {
|
|
|
66
66
|
exports.ConductorError = ConductorError;
|
|
67
67
|
/**
|
|
68
68
|
* Raised when an error occurs on the third-party integration's end while
|
|
69
|
-
* processing your end-user's request. E.g.,
|
|
70
|
-
*
|
|
69
|
+
* processing your end-user's request. E.g., cannot connect to QuickBooks
|
|
70
|
+
* Desktop on the end-user's computer.
|
|
71
71
|
*/
|
|
72
72
|
class ConductorIntegrationError extends ConductorError {
|
|
73
73
|
static rawType = "INTEGRATION_ERROR";
|
package/package.json
CHANGED