hpicgs / node

Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:

Home Page:https://nodejs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error handling via MaybeLocal

msoechting opened this issue · comments

The Node.js devs have the rule to never use throw in their code. This is fairly reasonable, since everything nodejs does is built on V8, which has it's own Exception class representing JS Exceptions, and C++'s exceptions can not be easily handled from JavaScript.

Decision to be made: Do we
a) go with Node's rule of never using C++ exceptions, forcing the consumer of our API to convert V8 exceptions into C++ exceptions, but probably making the merge into the node-master a bit easier, or do we
b) consciously DO use C++ exceptions, since the API is exposed to C++ (therefore making handling C++ exceptions easy) and handling V8's JS exceptions in C++ seems a bit cumbersome? With this, the merge will probably be a bit harder to pull off, since we need to argue why having C++ exceptions enabled is a good idea.

Thoughts?

Let's do a) IMHO, introduding exceptions into an exception-less project is a bad idea.

Waiting for merge (see #40).