Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request: error handler #187

Open
symful opened this issue Sep 25, 2024 · 2 comments
Open

feature request: error handler #187

symful opened this issue Sep 25, 2024 · 2 comments

Comments

@symful
Copy link

symful commented Sep 25, 2024

ret = try(@callback)
{
  isError: ValBool,
  isValue: ValBool,
  value: Value,
  error: Value
}

Will be great to have this as I am unable to make it by my own without messing the code in the main repository.

@JoeStrout
Copy link
Owner

This is an interesting idea. Currently being discussed in the Discord server — feel free to jump in!

@JoeStrout
Copy link
Owner

What specific sort of error do you want to trap with this? You can make this yourself, for any function you write, provided it does not contain MiniScript runtime errors. But runtime errors almost always indicate a bug in your code; you should fix the bug, rather than trap the result and do something about it.

So, what's the use case where you need some extra language support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants