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

Script Error line number incorrect #981

Open
AwooOOoo opened this issue Aug 16, 2020 · 4 comments
Open

Script Error line number incorrect #981

AwooOOoo opened this issue Aug 16, 2020 · 4 comments
Labels
awaiting triage Bugs awaiting developer initial investigation bug Something isn't working

Comments

@AwooOOoo
Copy link
Contributor

Describe the bug
Wrote a script with a syntactic error in it and the reported line number of the bug was incorrect. I assume the script is pre-pended with additional wrapping before being executed. In my case the error was on line 8, but was reported on line 16.

Write a script and it had a bug (extra quotes " in a notifications.info statement), but the reported line number was incorrect.
To Reproduce
Steps to reproduce the behavior:

  1. Write a script with a syntactic error (extra quotes " in a notifications.info statement)
  2. Execute script
  3. See error

Expected behavior
Error numbers to be reported to represent the line number of the script. this might become confusing with large scripts. Also having line numbers on the left hand side of the editor would be useful once these numbers are correct.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Browser: Chrome
  • Version: 84.0.4147.125 (Official Build) (64-bit)
@AwooOOoo AwooOOoo added awaiting triage Bugs awaiting developer initial investigation bug Something isn't working labels Aug 16, 2020
@badgerwithagun
Copy link
Member

Oooh, that's a tough one to fix! Perhaps if the error was reported along with a full copy of the appended script?

@AwooOOoo
Copy link
Contributor Author

Ì figured it would be, but thought I'd report.

Here is a minimalistic example that exhibits the issue. Notice there is only 4 lines.

function start() {
  notifications.alert("Hello world"")
  return SUCCESS
}

Here is the reported notification, which fails on line 9.

Script job 'Hello World' permanently failed: :9:37 Missing close quote notifications.alert("Hello world"") ^ in at line number 9 at column number 37

I expect the offset is always the same constant (7). I hate this type of hack, but you could filter the errors before they get pushed to the notifier and correct the line number. I expect however as more capabilities are added to the scripting system this constant (7) would change and this issue would reappear.

@badgerwithagun
Copy link
Member

@all-contributors add @AwooOOoo for bug reports

@allcontributors
Copy link
Contributor

@badgerwithagun

I've put up a pull request to add @AwooOOoo! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage Bugs awaiting developer initial investigation bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants