Skip to content

Commit 57c127a

Browse files
committed
Add error name to MakeError function in S7Client and S7Server
1 parent f4f8d31 commit 57c127a

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

src/node_snap7_client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ Napi::Error S7Client::MakeError(Napi::Env env, const std::string& context, int c
230230
msg << ": " << text;
231231
}
232232
Napi::Error err = Napi::Error::New(env, msg.str());
233+
err.Set("name", Napi::String::New(env, "Snap7Error"));
233234
err.Set("code", Napi::String::New(env, "SNAP7_CLIENT_CODE_" + std::to_string(code)));
234235
err.Set("errno", Napi::Number::New(env, code));
235236
return err;

src/node_snap7_server.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ Napi::Error S7Server::MakeError(Napi::Env env, const std::string& context, int c
392392
msg << ": " << text;
393393
}
394394
Napi::Error err = Napi::Error::New(env, msg.str());
395+
err.Set("name", Napi::String::New(env, "Snap7Error"));
395396
err.Set("code", Napi::String::New(env, "SNAP7_SERVER_CODE_" + std::to_string(code)));
396397
err.Set("errno", Napi::Number::New(env, code));
397398
return err;

0 commit comments

Comments
 (0)