conductor-node 8.5.2 → 8.5.3
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 +8 -11
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -192,8 +192,14 @@ The error object you receive will have one of the following error types:
|
|
|
192
192
|
| `ConductorConnectionError` | There was a network problem between the client (on your server) and Conductor's servers. |
|
|
193
193
|
| `ConductorInternalError` | Something went wrong on Conductor's end. (These are rare.) |
|
|
194
194
|
|
|
195
|
+
### Alerting
|
|
196
|
+
|
|
197
|
+
We recommend sending a **warning** to your error-tracking service (e.g., Sentry) for instances of `ConductorIntegrationError`, which are your end-user's fault (e.g., cannot connect to QBD on your end-user's computer) and sending an **error** for all other errors (e.g., invalid API key).
|
|
198
|
+
|
|
195
199
|
### Example
|
|
196
200
|
|
|
201
|
+
**NOTE:** We do not expect you to individually implement error handling as shown below for every API call. Ideally, we recommend implementing error handling in a single place in your app, such as a global error handler.
|
|
202
|
+
|
|
197
203
|
In the form of a rejected promise:
|
|
198
204
|
|
|
199
205
|
```ts
|
|
@@ -208,15 +214,7 @@ conductor.qbd.account
|
|
|
208
214
|
})
|
|
209
215
|
.catch((error) => {
|
|
210
216
|
if (error instanceof ConductorError) {
|
|
211
|
-
//
|
|
212
|
-
|
|
213
|
-
// RECOMMENDED: Send a *warning* to Sentry for integration-errors,
|
|
214
|
-
// which are your end-user's fault (e.g., cannot connect to QBD on
|
|
215
|
-
// your end-user's computer) or an *error* for other errors (e.g.,
|
|
216
|
-
// invalid API key).
|
|
217
|
-
Sentry.captureException(error, {
|
|
218
|
-
level: error instanceof ConductorIntegrationError ? "warning" : "error",
|
|
219
|
-
});
|
|
217
|
+
// Update your app's UI to display `error.endUserMessage`.
|
|
220
218
|
} else {
|
|
221
219
|
// ...
|
|
222
220
|
}
|
|
@@ -234,8 +232,7 @@ try {
|
|
|
234
232
|
});
|
|
235
233
|
} catch (error) {
|
|
236
234
|
if (error instanceof ConductorError) {
|
|
237
|
-
//
|
|
238
|
-
// ...
|
|
235
|
+
// Update your app's UI to display `error.endUserMessage`.
|
|
239
236
|
} else {
|
|
240
237
|
// ...
|
|
241
238
|
}
|
package/dist/package.json
CHANGED
package/package.json
CHANGED