my_tank_info 1.0.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 036f7ec0af8d4fca2dbbcf62c38e0999ee8c53d4ef70d9aaf85862842089e178
4
- data.tar.gz: eb89a5a9e1bba530dd379c6295857057e4dc29ce81017b396c0ec848d5b26c90
3
+ metadata.gz: f2d621c7a8a14148aacb4a0d76c5f5c0726ebe6858afc075144d375a0eae4c8c
4
+ data.tar.gz: fe65e36eb25268e2dc87a2c565a33a88442f1934d1a47e0d068f332221cbbef7
5
5
  SHA512:
6
- metadata.gz: 031657f4e3b4c59e69c0e3c601afc5d85f94001ad411e5eacf7003811dfab7360cb91ffe5c6b116a1b257c07173535326b4706e5468d70b973236146b588eaec
7
- data.tar.gz: fd170b24cd3e6d7b12ce0ee3f7645ff1548db36450755d3042a368deec477b0a6d8260d6f5cc20660cb5d990dd9b34e2183092c620f4e387d8d9b24d10719fa9
6
+ metadata.gz: d9aa100a21c9dd859b23377e033a712e810103967fd6a620e7602a6a2fde99ccffa6524bb094bdaaa270aa6d05975d6f199f1bf496b06e3028c2ab14bf739f71
7
+ data.tar.gz: ca4e444c8d55fac4a35e7c74da75ef5f539c667098a33f0fb840ec43043efd1f18fe88d88ad03054ccc5b155f8170a325c9908cefec4f9d6ab7daef4b9287271
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## [1.1.0] - 2021-09-23
2
+ - Added a specific error class ``MyTankInfo::UnauthorizedError`` so that it's easier to identify and react to scenarios when your api_key is wrong or has expired
3
+
1
4
  ## [1.0.2] - 2021-09-21
2
5
  - Add convenience methods for accessing UOM on TankReconciliationRecordCollection
3
6
  - Fix bug that prevented tank reconciliation records from being updated
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- my_tank_info (1.0.2)
4
+ my_tank_info (1.1.0)
5
5
  faraday (~> 1.7)
6
6
  faraday_middleware (~> 1.1)
7
7
 
data/README.md CHANGED
@@ -36,7 +36,7 @@ Once the token is generated it should be stored for use on all subsequent API re
36
36
  Practically speaking you'll need to store the username/password for then account you'd like to access
37
37
  so that you can periodically generate a new API token prior to expiration.
38
38
 
39
- Alternatively you can have your code catch _403 Forbidden_ errors and use that as a sign that a new API token is needed.
39
+ Alternatively you can have your code catch ``MyTankInfo::UnauthorizedError`` errors and use that as a sign that a new API token is needed.
40
40
 
41
41
  This is also the only call you can perform without providing an :api_key to the client
42
42
 
@@ -52,7 +52,7 @@ module MyTankInfo
52
52
  when 400
53
53
  raise Error, "Your request was malformed - #{message}"
54
54
  when 401
55
- raise Error, "You did not supply valid authentication credentials - #{message}"
55
+ raise UnauthorizedError, "You did not supply valid authentication credentials - #{message}"
56
56
  when 403
57
57
  raise RequestForbiddenError, "You are not allowed to perform that action - #{message}"
58
58
  when 404
@@ -67,6 +67,8 @@ module MyTankInfo
67
67
  end
68
68
  end
69
69
 
70
+ class UnauthorizedError < Error; end
71
+
70
72
  class MissingRequiredAttributeError < Error; end
71
73
 
72
74
  class RequestForbiddenError < Error; end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MyTankInfo
4
- VERSION = "1.0.2"
4
+ VERSION = "1.1.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_tank_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Keesling
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-09-21 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday