lib/rdstation/error_handler.rb in rdstation-ruby-client-1.0.1 vs lib/rdstation/error_handler.rb in rdstation-ruby-client-1.1.0

- old
+ new

@@ -2,20 +2,22 @@ require_relative 'error_handler/conflicting_field' require_relative 'error_handler/default' require_relative 'error_handler/expired_access_token' require_relative 'error_handler/expired_code_grant' require_relative 'error_handler/invalid_credentials' +require_relative 'error_handler/invalid_event_type' require_relative 'error_handler/resource_not_found' require_relative 'error_handler/unauthorized' module RDStation class ErrorHandler ERROR_TYPES = [ ErrorHandler::ConflictingField, ErrorHandler::ExpiredAccessToken, ErrorHandler::ExpiredCodeGrant, ErrorHandler::InvalidCredentials, + ErrorHandler::InvalidEventType, ErrorHandler::ResourceNotFound, ErrorHandler::Unauthorized, ErrorHandler::Default ].freeze @@ -40,10 +42,10 @@ def error_types ERROR_TYPES.map { |error_type| error_type.new(array_of_errors) } end def response_errors - JSON.parse(response.body)['errors'] + JSON.parse(response.body) end def error_formatter @error_formatter = RDStation::Error::Formatter.new(response_errors) end