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

Suggestion: onScriptError #1

Open
Sparker95 opened this issue Sep 11, 2019 · 1 comment
Open

Suggestion: onScriptError #1

Sparker95 opened this issue Sep 11, 2019 · 1 comment
Assignees

Comments

@Sparker95
Copy link

Hi!

Since you've asked, I'm making an issue.

Suggestion: add an SQF command: ADE_onScriptError code, which would call my code passed to it on a script error.

It should pass information about the script error to the callback, such as: file, line number, error text, and the callstack itself in string or array form.

Further things to think of: should it be stackable? What if we register the same code variable multiple times?

@dedmen dedmen self-assigned this Sep 12, 2019
@dedmen
Copy link
Owner

dedmen commented Sep 12, 2019

should it be stackable?

Honestly I'd just do a single handler thing. Otherwise I need to add tracking, and cleanup, and the ability to remove handlers and handler IDs and ugh.

Returns array callstack
[
[file, line, local variables],
[file, line, [["va1",val1], ["var2",val2]]],
...
]
Order will be either top->bottom or bottom->top whatever is easier.
It will still print to RPT.
For the local variables we might want to think about making a deep copy of the array after it was built.
If the local vars reference arrays they might change between error and the onScriptError handler.
Also the handler needs to be spawned as we can't interfere with the script vm while it's processing a error.

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

No branches or pull requests

2 participants