scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 57 forks source link

Unfriendly error when config file cannot be parsed #145

Closed CodeBrauer closed 6 years ago

CodeBrauer commented 8 years ago
$ dandelion --config=dev.yml status
/usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): did not find expected alphabetic or numeric character while scanning an alias at line 26 column 7 (Psych::SyntaxError)
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/psych.rb:318:in `parse'
    from /usr/local/Cellar/ruby/2.2.3/lib/ruby/2.2.0/psych.rb:245:in `load'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/config.rb:34:in `load'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/config.rb:10:in `initialize'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/cli.rb:15:in `new'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/cli.rb:15:in `config'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/cli.rb:21:in `adapter'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/cli.rb:37:in `workspace'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/lib/dandelion/cli.rb:69:in `execute!'
    from /usr/local/lib/ruby/gems/2.2.0/gems/dandelion-0.4.15/bin/dandelion:8:in `<top (required)>'
    from /usr/local/bin/dandelion:23:in `load'
    from /usr/local/bin/dandelion:23:in `<main>'

Dandelion works, till it needs a connection to the server.

$ dandelion --version:
Dandelion 0.4.15
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
$ gem -v
2.4.8
SteveEdson commented 8 years ago

Looks like you have a syntax error in your Yaml config. You could either share it here (removing passwords), or pass it through a validator like http://www.yamllint.com/.

scttnlsn commented 8 years ago

Yeah, that seems to be the issue. I should probably add some exception handling to print better error messages to the user.

CodeBrauer commented 8 years ago

@scttnlsn that would be awesome, found the error! (had to put one exclude in double quotes)

scttnlsn commented 6 years ago

Resolved via https://github.com/scttnlsn/dandelion/commit/6e25609a38b8914d47b5659dd31a941dcd738200