Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled rejection on 403 #12

Open
awlayton opened this issue Jan 31, 2020 · 0 comments
Open

Unhandled rejection on 403 #12

awlayton opened this issue Jan 31, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@awlayton
Copy link
Member

When oada-cache receives 403 sometimes the rejection is not passed up to the user of the library so there is no way to handle the rejection,

(node:3700) UnhandledPromiseRejectionWarning: Error: Request failed with status
code 403
    at WebSocket.socket.onmessage (/mnt/c/Users/alex/source/oada-srvc-docker/ser
vices-available/foo/node_modules/@oada/oada-cache/build/websocket.js:69:23)
    at WebSocket.onMessage (/mnt/c/Users/alex/source/oada-srvc-docker/services-a
vailable/foo/node_modules/ws/lib/event-target.js:120:16)
    at WebSocket.emit (events.js:321:20)
    at Receiver.receiverOnMessage (/mnt/c/Users/alex/source/oada-srvc-docker/ser
vices-available/foo/node_modules/ws/lib/websocket.js:720:20)
    at Receiver.emit (events.js:321:20)
    at Receiver.dataMessage (/mnt/c/Users/alex/source/oada-srvc-docker/services-
available/foo/node_modules/ws/lib/receiver.js:414:14)
    at Receiver.getData (/mnt/c/Users/alex/source/oada-srvc-docker/services-avai
lable/foo/node_modules/ws/lib/receiver.js:346:17)
    at Receiver.startLoop (/mnt/c/Users/alex/source/oada-srvc-docker/services-av
ailable/foo/node_modules/ws/lib/receiver.js:133:22)
    at Receiver._write (/mnt/c/Users/alex/source/oada-srvc-docker/services-avail
able/foo/node_modules/ws/lib/receiver.js:69:10)
    at doWrite (_stream_writable.js:454:12)
    at writeOrBuffer (_stream_writable.js:436:5)
    at Receiver.Writable.write (_stream_writable.js:327:11)
    at TLSSocket.socketOnData (/mnt/c/Users/alex/source/oada-srvc-docker/service
s-available/foo/node_modules/ws/lib/websocket.js:795:35)
    at TLSSocket.emit (events.js:321:20)
    at addChunk (_stream_readable.js:297:12)
    at readableAddChunk (_stream_readable.js:273:9)
    at TLSSocket.Readable.push (_stream_readable.js:214:10)
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:186:23)
(node:3700) 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 termina
te the node process on unhandled promise rejection, use the CLI flag `--unhandle
d-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejectio
ns_mode). (rejection id: 2)
@awlayton awlayton added the bug Something isn't working label Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant