Skip to content

[ http ] request method should handle 400...500 errors #4

Description

@kilgore5

need to make this error more understandable: https://github.com/kingandpartners/larsson_and_jennings/issues/597

Unauthorized response ends up with JSON::ParserError

need something like handle_response method in https://github.com/Shopify/active_utils/blob/master/lib/active_utils/posts_data.rb#L74

def handle_response(response)
      case response.code.to_i
      when 200...300
        response.body
      else
        raise ResponseError.new(response)
      end
    end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions