Native Exceptions

38 views
Skip to first unread message

Peter Hultqvist

unread,
Sep 6, 2014, 5:10:27 AM9/6/14
to shar...@googlegroups.com
Hello
I'l trying to get clean javascript throwing exceptions.

So far I have been using JsError, but it appears JsNativeError does what I want better.
My question though is why have both JsError and JsNativeError, what is the benefit of generating

throw
 $CreateException(new Error("Invalid path"), new Error());


rather than

throw new Error("Invalid path");

From C#:

throw new JsError("Invalid path");

Marek Fišera

unread,
Sep 8, 2014, 2:23:27 AM9/8/14
to shar...@googlegroups.com
Hi,
In the native version, you need to encode all information in the text message. The other version with classic .NET exception is more "semantic", you will text message + type of exception/error.

Marek

Dne sobota, 6. září 2014 11:10:27 UTC+2 Peter Hultqvist napsal(a):

Dan-el Khen

unread,
Sep 8, 2014, 6:19:11 AM9/8/14
to shar...@googlegroups.com
Yes, although the main reason to add this feature, was to get the correct stack trace. I believe that Sebastian can elaborate more about this if you want further info. You can also create your own exception class and mark it as native error and use it throughout your project.

D.


--
You received this message because you are subscribed to the Google Groups "SharpKit Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sharpkit+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages