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: Be verbose on errors, and quit on errors instead of beeing stuck without UI. #50

Open
dreirund opened this issue Oct 20, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@dreirund
Copy link

Is your feature request related to a problem? Please describe

When I start touche with a touchegg.conf which has invalid XML, touche does not show a GUI but also does not quit, and shows only unspecific error messages.

Example:

  • Take this touchegg.conf which contains the single character & whis is ivalid HTML (see this comment for details on that part) as ~/.config/touchegg/touchegg.conf.
  • Run touche.
  • touche produces the following terminal output:
    (com.github.joseexposito.touche:22701): Gtk-WARNING **: 10:57:40.714: Unknown key gtk-button-images in /[...]/.config/gtk-4.0/settings.ini
    
    (com.github.joseexposito.touche:22701): Gtk-WARNING **: 10:57:40.714: Unknown key gtk-menu-images in /[...]/.config/gtk-4.0/settings.ini
    
    (com.github.joseexposito.touche:22701): Gtk-WARNING **: 10:57:40.714: Unknown key gtk-toolbar-style in /[...]/.config/gtk-4.0/settings.ini
    Gjs-Message: 10:57:40.853: JS LOG: Reading configuration file "/[...]/.config/touchegg/touchegg.conf"
    
    (com.github.joseexposito.touche:22701): Gjs-CRITICAL **: 10:57:40.870: JS ERROR: Error: Unexpected close tag
    Line: 101
    Column: 15
    Char: >
    error@webpack:///../node_modules/sax/lib/sax.js?:684:10
    strictFail@webpack:///../node_modules/sax/lib/sax.js?:711:12
    closeTag@webpack:///../node_modules/sax/lib/sax.js?:913:19
    write@webpack:///../node_modules/sax/lib/sax.js?:1549:21
    module.exports@webpack:///../node_modules/xml-js/lib/xml2js.js?:411:12
    loadConfig@webpack:///../src/config/xml-config.js?:89:66
    loadFromFile@webpack:///../src/config/model.js?:103:57
    showMainView@webpack:///../src/app-window.js?:84:59
    _init@webpack:///../src/app-window.js?:61:12
    main/<@webpack:///../src/index.js?:53:22
    main@webpack:///../src/index.js?:58:22
    run@resource:///org/gnome/gjs/modules/script/package.js:206:19
    @/usr/bin/touche:11:17
    
  • touche does not come up with a user interface, but also does not quit but stays stuck.

Describe the solution you'd like

  • Give a clear error message saying at which line it encountered which problem,
  • exit with a non-zero exitcode.

Additional context

Issue #48.

@JoseExposito
Copy link
Owner

Thanks for the detailed feature request.

Definitely something needed, some users might not know how to run it from terminal and end up with no feedback.

@dreirund
Copy link
Author

dreirund commented Oct 20, 2021

... I just see that the error message I posted above does indeed show the position in the touchegg.conf where it encountered the error. I did not notice that in first place, because the error message was so loaded with other stuff that it was not clear for me what to watch out for.

It would be helpful if it would say something precise like Error parsing XML in file <filename> at line <x>, character <y> or so, and without all that JavaScript-stuff.

Yes, and a graphical dialogue window with error message as well, you are right.

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

No branches or pull requests

2 participants