Class: DocusignDtr::Auth::Error
- Inherits:
-
Object
- Object
- DocusignDtr::Auth::Error
- Defined in:
- lib/docusign_dtr/auth/error.rb
Instance Method Summary collapse
- #build ⇒ Object
- #exception ⇒ Object
-
#initialize(response:) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(response:) ⇒ Error
Returns a new instance of Error.
4 5 6 |
# File 'lib/docusign_dtr/auth/error.rb', line 4 def initialize(response:) @response = response end |
Instance Method Details
#build ⇒ Object
8 9 10 11 12 |
# File 'lib/docusign_dtr/auth/error.rb', line 8 def build return nil if @response.code == 200 raise exception.new() end |
#exception ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/docusign_dtr/auth/error.rb', line 14 def exception case @response.code when 400 general_error when 401 DocusignDtr::Unauthorized when 403 DocusignDtr::Forbidden when 204 DocusignDtr::NoContent else StandardError end end |