lib/lifen/user_authenticated_client.rb in lifen-1.0.1 vs lib/lifen/user_authenticated_client.rb in lifen-1.0.2
- old
+ new
@@ -7,21 +7,25 @@
attr_reader :token
private
- def handle_status!(response)
- super(response)
+ def handle_errors(response, params)
+ super(response, params)
case response.status
when 400
- raise InvalidParamsError, "Invalid params"
+ raise InvalidParamsError, "Error 400, Invalid params, #{response_error(response, params)}"
when 401
- raise UnauthorizedError, "Token is not valid"
+ raise UnauthorizedError, "Error 401, Token is not valid, #{response_error(response, params)}"
when 403
- raise Error, "Action is forbidden"
+ raise Error, "Error 403, Action is forbidden, #{response_error(response, params)}"
end
+ end
+
+ def response_error(response, params)
+ "User Client, #{super(response, params)}"
end
def bearer
token.value
end
\ No newline at end of file