api-blueprint 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: df6ecb25a5ab69c7b15ca05cc4e4c529f7758fbf
4
- data.tar.gz: dedd52941d8666ee9e2ca1cb95f357c72815e47a
3
+ metadata.gz: 92b97a2c669c6b891dca65a5d31a2bfa703951bd
4
+ data.tar.gz: 90dd0b51277c9d8e8279ada2be73e1255c61b75e
5
5
  SHA512:
6
- metadata.gz: de025ec5d1d92bb6cc9a182cdedccf4f11fc2eef8c19e92dd81475dd7f4220bff4f5cbd7866a1d70209da013b21752c71ab9bc0b9ae75fd49bc74179ea0b327d
7
- data.tar.gz: 3eb72f7030802241df6fc5dcd4704a55dafb165b6adc46edd9f2bec2af35c2f472a2b5dfe2ea62939de0a7c22fd176abbdf36e0562c8f9020431622f1ab20b18
6
+ metadata.gz: 9d36fd33e0683abc566069d8b2698d9317f12fa65e76f0bce55e313bfa43ceb5c1a9191d282cd01359221bd4b012dd6abcccf8b8f4813a10e3a648f184ca72e3
7
+ data.tar.gz: 242e8eda32ad332e4ebf46e538dcb6173bcbaf8d293ab888ff7aa5a3f7e26fba00a411b295d5577de5b62223209e874c5044ca8d714f1cafaf73d628c943ec12
data/README.md CHANGED
@@ -126,9 +126,10 @@ Certain response statuses will also cause ApiBlueprint to behave in different wa
126
126
 
127
127
  | HTTP Status range | Behavior |
128
128
  | ----------------- | -------- |
129
- | 200 - 400 | Objects are built normally, no errors raised |
129
+ | 200 - 399 | Objects are built normally, no errors raised |
130
130
  | 401 | raises `ApiBlueprint::UnauthenticatedError` |
131
- | 402 - 499 | raises `ApiBlueprint::ClientError` |
131
+ | 404 | raises `ApiBlueprint::NotFoundError` |
132
+ | 400 - 499 | raises `ApiBlueprint::ClientError` |
132
133
  | 500 - 599 | raises `ApiBlueprint::ServerError` |
133
134
 
134
135
  ## Access to response headers and status codes
@@ -24,4 +24,5 @@ module ApiBlueprint
24
24
  class ServerError < StandardError; end
25
25
  class UnauthenticatedError < StandardError; end
26
26
  class ClientError < StandardError; end
27
+ class NotFoundError < StandardError; end
27
28
  end
@@ -5,6 +5,8 @@ module ApiBlueprint
5
5
  case env[:status]
6
6
  when 401
7
7
  raise ApiBlueprint::UnauthenticatedError, response_values(env)
8
+ when 404
9
+ raise ApiBlueprint::NotFoundError, response_values(env)
8
10
  when 402..499
9
11
  raise ApiBlueprint::ClientError, response_values(env)
10
12
  when 500...599
@@ -1,3 +1,3 @@
1
1
  module ApiBlueprint
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api-blueprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damien Timewell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-20 00:00:00.000000000 Z
11
+ date: 2018-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-types