From 3862fdade424793174a5bd2dba40f86c8f3f27c2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 31 Aug 2009 18:48:47 +0200 Subject: [PATCH] Throw Error exceptions from node.dlopen() --- src/node.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/node.cc b/src/node.cc index bd160164b2..f8d5b7269c 100644 --- a/src/node.cc +++ b/src/node.cc @@ -126,13 +126,15 @@ node_dlopen (const v8::Arguments& args) void *handle = dlopen(*filename, RTLD_LAZY); if (handle == NULL) { - return ThrowException(String::New("dlopen() failed.")); + Local exception = Exception::Error(String::New(dlerror())); + return ThrowException(exception); } void *init_handle = dlsym(handle, "init"); if (init_handle == NULL) { - ThrowException(String::New("No 'init' symbol found in module.")); - return Undefined(); + Local exception = + Exception::Error(String::New("No 'init' symbol found in module.")); + return ThrowException(exception); } extInit init = reinterpret_cast(init_handle);