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

Add an option to notify errors #388

Closed
gizellos opened this issue Jan 12, 2018 · 9 comments
Closed

Add an option to notify errors #388

gizellos opened this issue Jan 12, 2018 · 9 comments

Comments

@gizellos
Copy link

gizellos commented Jan 12, 2018

Is it possible to display errors from console on screen or to a file? It could be quite useful feature for hunting bugs we are not aware of. It would be disabled by default, of course.

@rafaelgomesxyz
Copy link
Owner

It's not possible to capture errors shown in the console that are not written with console.log without try...catch, and I don't use try...catch in a lot of places at the moment, because I have to deal with #353 first.

So I can add this, but at the moment it will only capture errors from Game Categories and the logs I added to Multiple Giveaways Creator in #332.

@gizellos
Copy link
Author

I see. Take your time.

@rafaelgomesxyz rafaelgomesxyz changed the title Display errors from console on screen Add an option to notify errors Jan 12, 2018
@rafaelgomesxyz
Copy link
Owner

Well, I already added the option, now I just have to expand the use of try...catch as I work on #353. You can test it by going to the debug menu and writing something gibberish, like gibberish.

@rafaelgomesxyz rafaelgomesxyz added this to the 7.13.0 milestone Jan 12, 2018
@gizellos
Copy link
Author

It's good but I would prefer to enhance it a bit. It would open a window after I click on the new icon. In the window, there would be this:

  1. The error itself
  2. Button "Copy to clipboard"
  3. Button "Save to TXT"
  4. Button "Ignore this error" (this is very important)

The function for the button "Ignore this error" could be a bit smart and could try to recognize the same errors that have just a different unimportant parts. I mean if I click to ignore error, for example "error on page xxx, foobar is not defined", it would recognize that a new error "error on page yyy, foobar is not defined" is the same error and it would ignored it. This can be quite complex, though. It is just a though...

Also if there was the function "Ignore this error", it would be useful to have the possibility to see all the ignored errors in a list and have the possibility to remove them from the ignore list.

@rafaelgomesxyz
Copy link
Owner

Wouldn't an option to ignore errors make the feature a bit useless? There wouldn't be a simple way to identify an exact error that would be accurate.

@rafaelgomesxyz
Copy link
Owner

Plus I don't think that's necessary, errors should only appear in the console if they are actually errors that need to be fixed, which means I should remove Game Categories errors from the list because they can happen all the time because of Steam being unavailable and just output them to the console normally.

There are a lot of checks in the script, so for example, foobar is not defined would never happen unless something needs to be fixed, because if foobar is an element that sometimes does not exist, the code would be prepared to deal with that: if (foobar) { // do something }

rafaelgomesxyz pushed a commit that referenced this issue Jan 13, 2018
@rafaelgomesxyz
Copy link
Owner

Just pushed a commit that adds 1-3, but I'm reluctant to add 4, as stated above.

rafaelgomesxyz pushed a commit that referenced this issue Jan 13, 2018
@gizellos
Copy link
Author

gizellos commented Jan 13, 2018

The idea of the ignoring the error is that I would make an issue here and I wouldn't need to see the error anymore because it would be already reported. Then I could hunt for some other errors. Else if I saw the error icon somewhere, I wouldn't want to click on it, because I would think that it is the error I already reported. So I would ignore it only after reporting it.

Edit: I just realized that it wouldn't work because the errors could appear even after fixing them so the ignored old errors would be ignored even if they shouldn't be. The ignoring would have to be just for a specific time which is not very elegant.

Edit 2: I already know, the function would have to ignore the error until next script version. It could work well.

@gizellos
Copy link
Author

The window works and looks very good. I just tried it. :)

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