codex-team / codex-team/hawk.javascript

Bad plain object handling as PromiseRejectionEvent reason

Aperta
#171 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
32
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Currently when a promise is rejected with a plain object instead of an Error `Promise.reject({ code: 42, detail: 'oops' })`, the catcher loses the object content - `String(obj)` produces `"[object Object]"`.

The console catcher also falls back to `event.reason?.message || String(event.reason)`, which either picks up an accidental `message` property or produces the same useless string.

Image

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.