This repository was archived by the owner on Jan 16, 2024. It is now read-only.
File tree 3 files changed +32
-1
lines changed
3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ add_library(${PROJECT_NAME} SHARED
27
27
"src/ng-test.cpp"
28
28
"src/QWidgetWrap/qwidget_wrap.cpp"
29
29
"src/utils.cpp"
30
- )
30
+ "src/exceptions.cpp" )
31
31
32
32
link_directories ($ENV{QT_LIBRARIES} )
33
33
Original file line number Diff line number Diff line change
1
+ #include " exceptions.h"
2
+ #include " napi.h"
3
+
4
+ void throwInvalidKeyException (const Napi::Env &env) {
5
+ return Napi::TypeError::New (env, " argument key must be a string" )
6
+ .ThrowAsJavaScriptException ();
7
+ }
8
+
9
+ void throwInvalidArgumentsException (const Napi::Env &env) {
10
+ return Napi::TypeError::New (env, " Wrong number of arguments" )
11
+ .ThrowAsJavaScriptException ();
12
+ }
13
+
14
+ void throwInvalidModifierException (const Napi::Env &env) {
15
+ return Napi::TypeError::New (env, " argument modifier must be a number" )
16
+ .ThrowAsJavaScriptException ();
17
+ }
18
+
19
+ void throwInvalidDelayException (const Napi::Env &env) {
20
+ return Napi::TypeError::New (env, " argument delay must be a number" )
21
+ .ThrowAsJavaScriptException ();
22
+ }
Original file line number Diff line number Diff line change
1
+ #include "napi.h"
2
+
3
+ void throwInvalidKeyException (const Napi ::Env & env );
4
+
5
+ void throwInvalidArgumentsException (const Napi ::Env & env );
6
+
7
+ void throwInvalidModifierException (const Napi ::Env & env );
8
+
9
+ void throwInvalidDelayException (const Napi ::Env & env );
You can’t perform that action at this time.
0 commit comments