Integrated Dynamics

Integrated Dynamics

63M Downloads

Error operator

kirjorjos opened this issue · 6 comments

commented

Issue type:

  • ➕ Feature request

Short description:

An operator with the signature String -> Any that if triggered, will throw the given string as a standard error when hovering over the red X in a part trying to use the final card. Example usage would be:

choice(bool, str, error(str)) :: Boolean -> String -- returns the string if bool is true, errors the string if bool is false

adding to Integrated Dynamics, it "would then also work in [Integrated Scripting]"

commented

Thanks for the suggestion!

commented

With this, do we think an Any -> String catch operator might be a good idea? Either returns the error string or some default string, or Any -> String -> String if we don't want to do a default string.

commented

Something like that could be useful indeed!

commented

Do you have any preference for if it should have a String input or default string, and if default, what it should be?

commented

Any -> String -> String makes more sense to me atm. But I don't have a strong preference tbh.

commented

Operator for throwing a new error added in 5d8864a