how to define my own error.errCode and error.errMsg?

View: New views
1 Messages — Rating Filter:   Alert me  

how to define my own error.errCode and error.errMsg?

by Aiscanf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

hi, guys,
i am not sure how to throw the exception  so that in js code i can
using print(error.errCode +  error.errMsg).
here is the example:

//c++ code
 void  my_own_func( )
 {
    try {
       // some c++ code here
   }catch(exception&error)
   {
      // ------what to do here???? using JS_ReportErrorNumber ?i have
tested it but not run well.
   }
 }


// filename: test.js

try{
// some js code;
}
catch(error)
{
     print(error.errCode +  error.errMsg);  //how can make this run well????
}

thx
:)
--
best regards
_______________________________________________
dev-tech-js-engine mailing list
dev-tech-js-engine@...
https://lists.mozilla.org/listinfo/dev-tech-js-engine