try/catch in HandleOKCallback
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 74
- Forks
- 9
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp, node.js
- Área
- backend
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100