mapbox / mapbox/node-cpp-skel

try/catch in HandleOKCallback

Aperta
#114 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

good first issue
Lingua principale
C++
Stelle
74
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

We should add try/catch around code in the HandleOKCallback like https://github.com/mapbox/node-cpp-skel/blob/c3d13e76cfb1178c92bf8beca822da4aba8c28f7/src/object_async/hello_async.cpp#L179-L186. Otherwise down stream developers are likely to:

- add new code to the HandleOKCallback
- in many instances that code might throw
- a throw will not be caught automatically and will instead crash the process with an `abort`

An example is https://github.com/mapbox/vtquery/issues/69 /cc @mapsam

We must protect against crashes like this, so I think its worth adding try/catch around the code in node-cpp-skel. Then users would be forced (due to the lack of coverage of the `catch` to think hard about whether an exception is possible.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Start with the referenced src/object_async/hello_async.cpp example, especially lines 179-186, and locate HandleOKCallback in node-cpp-skel. Add the requested exception handling around its callback code, then verify that downstream exceptions are caught rather than aborting the process.

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

Valutazione

Stack tecnologico
cpp, node.js
Ambito
backend
Tipo di issue
Funzionalità
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
38/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.