Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

rework of the error handling #11

Merged
merged 1 commit into from
Jan 21, 2016
Merged

rework of the error handling #11

merged 1 commit into from
Jan 21, 2016

Conversation

jannik-hh
Copy link
Contributor

add more specific error classes
access the entire response from the error object
access the error descriptions directly from the error object

@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch 2 times, most recently from 18f0fac to ebe97fd Compare January 14, 2016 08:47
@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch 3 times, most recently from 2436b75 to cfe04bc Compare January 18, 2016 12:12
@jannik-hh jannik-hh assigned jannik-hh and sfroehler and unassigned sfroehler and jannik-hh Jan 18, 2016
@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch from cfe04bc to 85f9526 Compare January 20, 2016 15:53

private

def self.error_class_for(response_code)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private (on line 24) does not make singleton methods private. Use private_class_method or private inside a class << self block instead.

@bvogel
Copy link

bvogel commented Jan 21, 2016

Hi @sfroehler - any reason why this wasn't included in the 0.6.0 release? This was the most interesting part to us!

@sfroehler
Copy link
Contributor

Hi @bvogel

It was not included because this is a breaking change and we needed a release with the remaining changes.
A release including this PR will follow later today.

@bvogel
Copy link

bvogel commented Jan 21, 2016

😄 👍

@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch 3 times, most recently from cc293e2 to 92ec495 Compare January 21, 2016 13:38
@sfroehler
Copy link
Contributor

ready to merge

@sfroehler sfroehler assigned jannik-hh and unassigned sfroehler Jan 21, 2016
@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch from 92ec495 to ff523a1 Compare January 21, 2016 14:02

Shipcloud::Request::Base.new(info).perform
expect { Shipcloud::Request::Base.new(info).perform }.to raise_error(Shipcloud::ShipcloudError)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [101/100]

 add more specific error classes
 access the entire response from the error object
 access the error descriptions directly from the error object
@jannik-hh jannik-hh force-pushed the jg-rework-error-handling branch from ff523a1 to 7dfabd6 Compare January 21, 2016 14:03
jannik-hh added a commit that referenced this pull request Jan 21, 2016
@jannik-hh jannik-hh merged commit 450ebb6 into master Jan 21, 2016
@jannik-hh jannik-hh deleted the jg-rework-error-handling branch January 21, 2016 14:14
sfroehler added a commit that referenced this pull request Jan 21, 2016
Added
- Add the possibility to specify the api key on every request. (#8)
- Add some more specific error classes ```Shipcloud::ClientError```,```Shipcloud::ServerError```,
  ```Shipcloud::InvalidRequestError```, ```Shipcloud::TooManyRequests``` and ```Shipcloud::NotFoundError``` (#11).
- Access to the entire response and error descriptions from the error object (#11).

Removed
- Removed the following ruby versions from travis-ci test runs:
  - jruby-9.0.0.0
- Removed ```Shipcloud::APIError```  in preference to more granular error classes (#11).
@bvogel
Copy link

bvogel commented Jan 21, 2016

Now I'm confused - as per SemVer I would have expected this to go into a mayor release (as it is breaking?)

@sfroehler
Copy link
Contributor

From semver.org:

Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable.
(http://semver.org/#spec-item-4)

As I mentioned before we did a separate release to make the remaining changes available without introducing a breaking change.

@bvogel
Copy link

bvogel commented Jan 21, 2016

Thanks for clearing that up - so when is v1.0.0 to be expected? :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants