fable-import icon indicating copy to clipboard operation
fable-import copied to clipboard

Node bindings - Remove usage of JS.Error and friends

Open jgrund opened this issue 7 years ago • 2 comments

Since F# has System.Exception, I'm wondering if we should just use that (and extend it where necessary) in the node bindings.

jgrund avatar Feb 09 '18 15:02 jgrund

This can make sense if we have custom Exception when possible (with custom fields, etc.) to make it easier to access the Error/Exception info.

Otherwise not sure to see the difference between JS.Error and Exception. Would this cause some problems/conflicts in the error definition for third parties libs ?

MangelMaxime avatar Feb 09 '18 16:02 MangelMaxime

Fable translates .NET System.Exception to JS Error and makes equivalence between the Message and StackTrace property (reference). So the proposal makes sense :)

When you define a custom exception it will extend JS Error in generated code, but I'm not sure right now how that would work in the bindings, haven't tried yet 🤔

alfonsogarciacaro avatar Feb 12 '18 08:02 alfonsogarciacaro