In production we sometimes get TypeError "exception object expected", from the call method in client.rb originating from the following lines:
|
raise Teamtailor::Error.from_response( |
|
body: response.body, |
|
status: response.code |
|
) |
I think it's because the Teamtailor::Error.from_response method doesn't have an "else"-statement:
|
def self.from_response(body:, status:) |
|
case status |
|
when 401 |
|
Teamtailor::UnauthorizedRequestError.new |
|
when 406 |
|
json_response = JSON.parse(body) |
|
Teamtailor::InvalidApiVersionError.new( |
|
json_response.dig("errors", "detail") |
|
) |
|
when 422 |
|
json_response = JSON.parse(body) |
|
Teamtailor::UnprocessableEntityError.new( |
|
json_response.dig("errors", 0, "detail") |
|
) |
|
end |
|
end |
In production we sometimes get TypeError "exception object expected", from the
callmethod in client.rb originating from the following lines:teamtailor-rb/lib/teamtailor/request.rb
Lines 33 to 36 in 0414684
I think it's because the Teamtailor::Error.from_response method doesn't have an "else"-statement:
teamtailor-rb/lib/teamtailor/error.rb
Lines 5 to 20 in 0414684