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

Service requests for Invalid DataCenters throw unhelpful exceptions #40

Closed
warmfusion opened this issue Jun 11, 2015 · 2 comments
Closed

Comments

@warmfusion
Copy link
Contributor

When trying to get a list of services for an explicit datacenter, I found if the DC wasn't found, or otherwise invalid, the service request throws a 500 error and doesn't give any useful feedback.

Could this be setup to be more explicit Diplomat/Consul related exception ?

irb(main):006:0> Diplomat::Service.get('redis?dc=no_such_dc')
Faraday::ClientError: the server responded with status 500
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response/raise_error.rb:13:in `on_complete'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:9:in `block in call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/response.rb:8:in `call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/request/url_encoded.rb:15:in `call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:56:in `call'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
    from /var/lib/gems/1.9.1/gems/faraday-0.9.1/lib/faraday/connection.rb:140:in `get'
    from /var/lib/gems/1.9.1/gems/diplomat-0.12.0/lib/diplomat/service.rb:22:in `get'
    from /var/lib/gems/1.9.1/gems/diplomat-0.12.0/lib/diplomat/rest_client.rb:46:in `method_missing'
    from (irb):6
    from /usr/bin/irb:12:in `<main>'
@johnhamelink
Copy link
Member

Agreed. I'll work on a PR for this over the weekend.

@johnhamelink
Copy link
Member

Fixed in 0.13.0

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