ChatPlug / ChatPlug/libfb-js

How can I use the built-in custom errors?

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

Descrizione

I am rather new to NodeJS, so forgive me for any basic errors.

That said, I've been trying to see if a thrown error is of type `AttachmentNotFoundError`. However, I don't think this error type is actually exported anywhere, and thus any attempt to use `instanceof AttachmentNotFoundError` results in `TypeError: Right-hand side of 'instanceof' is not an object` or `ReferenceError: AttachmentNotFoundError is not defined`.

Is there any way I can import this from `src/types/errors`? Thanks!

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia ispezionando src/types/errors e le esportazioni pubbliche del pacchetto per determinare come viene esposto AttachmentNotFoundError. Verifica il percorso di importazione previsto e conferma che un AttachmentNotFoundError lanciato possa essere riconosciuto con instanceof; il lavoro è completato quando i consumer possono usare il tipo di errore personalizzato senza un TypeError a runtime.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
node.js, typescript
Ambito
backend
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.