You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered an issue when initializing the self-sdk library with invalid credentials. When this happens, a 401 error is thrown, and the error message is not very informative for the end-user.
The error message looks like this:
[2023-03-24T09:00:54.000Z] WARN AxiosError: Request failed with status code 401
at settle (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/axios/dist/node/axios.cjs:1900:12)
at IncomingMessage.handleStreamEnd (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/axios/dist/node/axios.cjs:2952:11)
at IncomingMessage.emit (events.js:326:22)
at endReadableNT (_stream_readable.js:1241:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ERR_BAD_REQUEST',
config: [Object],
request: [ClientRequest],
response: [Object]
}
(node:45046) UnhandledPromiseRejectionWarning: Error: internal error
at new IdentityService (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/self-sdk/dist/self-sdk.umd.js:967:32)
at Function.<anonymous> (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/self-sdk/dist/self-sdk.umd.js:8139:51)
at step (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/self-sdk/dist/self-sdk.umd.js:107:27)
at Object.next (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/self-sdk/dist/self-sdk.umd.js:88:57)
at fulfilled (/Users/adriancidrejugo/tmp/self-ts-sdk/_examples/authentication/node_modules/self-sdk/dist/self-sdk.umd.js:78:62)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:45046) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:45046) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
To improve the user experience and provide better guidance for troubleshooting, I suggest improving the error handling in the library when initializing with invalid credentials or when the SELF_ENV environment variable is set incorrectly.
The text was updated successfully, but these errors were encountered:
I encountered an issue when initializing the self-sdk library with
invalid credentials
. When this happens, a 401 error is thrown, and the error message is not very informative for the end-user.The error message looks like this:
To improve the user experience and provide better guidance for troubleshooting, I suggest improving the error handling in the library when initializing with invalid credentials or when the SELF_ENV environment variable is set incorrectly.
The text was updated successfully, but these errors were encountered: