File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ template catchJsErrAsCode*(doBody: static string): int =
27
27
var
28
28
res: cint = 0
29
29
{.emit: [" try{" , doBody, " } catch(e) {" ,
30
- res, " = e.code ; }"
30
+ res, " = -e.errno ; }"
31
31
# " <- for code lint
32
32
].}
33
33
int - res # nodejs's errno is oppsite?
@@ -37,7 +37,7 @@ template catchJsErrAsCode*(prc: proc ()): cint =
37
37
block :
38
38
{.emit: [" try{" , prc, " ();" ,
39
39
" } catch(e) {" ,
40
- res, """ = e.code ;
40
+ res, """ = -e.errno ;
41
41
}
42
42
""" ].}
43
43
# """] <- for code lint
@@ -54,7 +54,7 @@ template catchJsErrAsCode*(errMsg: var string; doBody: static string): cint =
54
54
res: cint = 0
55
55
{.emit: [" try{" , doBody, """
56
56
} catch(e) {
57
- """ , res, " = e.code ;" ,
57
+ """ , res, " = -e.errno ;" ,
58
58
jsRes,""" = e.message;
59
59
}
60
60
""" ].}
@@ -69,7 +69,7 @@ template catchJsErrAsCode*(errMsg: var string; prc: proc): cint =
69
69
block :
70
70
{.emit: [" try{" , prc, """ ();
71
71
} catch(e) {
72
- """ ,res, " = e.code ;" ,
72
+ """ ,res, " = -e.errno ;" ,
73
73
jsRes,""" = e.message;
74
74
}
75
75
""" ].}
You can’t perform that action at this time.
0 commit comments