Skip to content

Commit

Permalink
throw Error instead of TypeError when arguments check failed
Browse files Browse the repository at this point in the history
  • Loading branch information
yeyuanfeng committed Jul 13, 2017
1 parent dbcc334 commit ae9c3b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace bsdpNode {
HandleScope scope(isolate);

if (!args[0]->IsString() || !args[1]->IsString() || !args[2]->IsString()) {
isolate->ThrowException(Exception::TypeError(
isolate->ThrowException(Exception::Error(
String::NewFromUtf8(isolate, "Invalid arguments.")));
return;
}
Expand All @@ -40,8 +40,9 @@ namespace bsdpNode {
HandleScope scope(isolate);

if (!args[0]->IsString() || !args[1]->IsString() || !args[2]->IsString()) {
isolate->ThrowException(Exception::TypeError(
isolate->ThrowException(Exception::Error(
String::NewFromUtf8(isolate, "Invalid arguments.")));
return;
}

String::Utf8Value oldfile(args[0]);
Expand Down

0 comments on commit ae9c3b0

Please sign in to comment.