gr icon indicating copy to clipboard operation
gr copied to clipboard

Check config format, add a useful message

Open Marwe opened this issue 7 years ago • 1 comments

I messed up my ~/.grconfig.json (excess comma at end of a list due to deletion of last entry) and found the resulting error message to be not exactly informative. Maybe this can be handled better, such that a (syntax) check is included and a useful "config messed up"-message can be shown.

gr git status
/usr/lib/node_modules/git-run/lib/command-requirements.js:8
    if (gitCommand.stderr.toString().replace(/(\r\n|\n|\r)/gm, '').trim()) {
                         ^

TypeError: Cannot read property 'toString' of null
    at Object.git (/usr/lib/node_modules/git-run/lib/command-requirements.js:8:26)
    at Object.module.exports [as handle] (/usr/lib/node_modules/git-run/plugins/run.js:29:38)
    at next (/usr/lib/node_modules/git-run/index.js:244:11)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)
    at next (/usr/lib/node_modules/git-run/index.js:227:14)

Thanks for this great piece of software!

Marwe avatar Jul 10 '18 07:07 Marwe

My guess is that this isn't handled super elegantly because it's not expected that the users will be editing that file directly

roytruelove avatar Aug 23 '18 03:08 roytruelove