Replies: 1 comment 2 replies
-
I will have a look at it, for JavaScript it should be easy enough because F# exception don't derive from Current type: // Exception is intentionally not derived from Error, for performance reasons (see #2160)
export class Exception {
constructor(public message?: string) { }
} We could have an additional argument and the getter that goes with it. I have however a question regarding the F# code you are trying to map from? Looking online for inner exception with F# I found: open System
type FooException(message:string, innerException:Exception) =
inherit Exception(message)
let e = new Exception()
raise (new FooException("test", e)) Is it what you are trying to do or something else? I am asking because the |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Would it be possible to support
System.Exception.get_InnerException
?It currently fails at compile time with
error FABLE: System.Exception.get_InnerException is not supported by Fable
.For javascript, it could map to the
cause
parameter:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause#rethrowing_an_error_with_a_cause
and on python
https://python-future.org/compatible_idioms.html#raising-exceptions
raise_from
Not sure about other targets, but it can be helpful for debugging to make use of the underlying platform's ability to decorate an error with additional context information, but not lose track of the original message and trace.
Beta Was this translation helpful? Give feedback.
All reactions