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
- #full_message ⇒ 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 exception.new() end |
#exception ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/docusign_dtr/auth/error.rb', line 18 def exception case @response.code when 400 general_error when 401 DocusignDtr:: when 403 DocusignDtr::Forbidden when 204 DocusignDtr::NoContent else StandardError end end |
#full_message ⇒ Object
14 15 16 |
# File 'lib/docusign_dtr/auth/error.rb', line 14 def "Error communicating: Response code #{@response.code}" end |