Ideally the type check is done in JS land so the C++ code can simply do:

```c++
assert(args[0]->IsString());
Local<String> s = args[0].As<String>();
```

If the type check has to be done in C++ land, then throwing if it's not the expected type is the idiomatic thing to do (in the node.js core code base anyway.)