drewblessing / gitlab-cli

GitLab Command Line Tool - Interact with your GitLab server via the command line to manage snippets, projects and more.
MIT License
166 stars 20 forks source link

Improve error handling for times when Gitlab is not accessible #7

Closed drewblessing closed 11 years ago

drewblessing commented 11 years ago

Currently, if the Gitlab instances specified in the config file is not accessible the user gets a nasty trace:

gitlab-cli/lib/gitlab/util.rb:12:in `projects': undefined method `response' for #<SocketError:0x10d679658> (NoMethodError)
    from /Users/drewb/development/gitlab-cli/bin/gitlab:15:in `projects'
    from /Library/Ruby/Gems/1.8/gems/thor-0.17.0/lib/thor/task.rb:27:in `__send__'
    from /Library/Ruby/Gems/1.8/gems/thor-0.17.0/lib/thor/task.rb:27:in `run'
    from /Library/Ruby/Gems/1.8/gems/thor-0.17.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /Library/Ruby/Gems/1.8/gems/thor-0.17.0/lib/thor.rb:344:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/thor-0.17.0/lib/thor/base.rb:434:in `start'
    from /Users/drewb/development/gitlab-cli/bin/gitlab:49