summaryrefslogtreecommitdiff
path: root/test/addons/errno-exception/binding.cc
blob: bf83fb216824f01ae7160742c9041976b31f19b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <node.h>
#include <v8.h>

void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
  v8::Isolate* isolate = args.GetIsolate();
  v8::HandleScope scope(isolate);
  args.GetReturnValue().Set(node::ErrnoException(isolate,
                                                10,
                                                "syscall",
                                                "some error msg",
                                                "päth"));
}

void init(v8::Local<v8::Object> exports) {
  NODE_SET_METHOD(exports, "errno", Method);
}

NODE_MODULE(NODE_GYP_MODULE_NAME, init)