lib/lifen/app_authenticated_client.rb in lifen-1.0.1 vs lib/lifen/app_authenticated_client.rb in lifen-1.0.2

- old
+ new

@@ -1,23 +1,27 @@ module Lifen class AppAuthenticatedClient < Client private - def handle_status!(response) - super(response) + def handle_errors(response, params) + super(response, params) case response.status when 400 - raise Error, "Error 400" + raise Error, "Error 400, Unknown error, #{response_error(response, params)}" when 401 - raise InvalidSecretTokenError + raise InvalidSecretTokenError, "Error 401, Invalid app bearer, #{response_error(response, params)}" when 403 - raise UserAlreadyExistingError + raise UserAlreadyExistingError, "Error 403, User already existing, #{response_error(response, params)}" when 404 - raise Error, "Error 404, Page not found" + raise Error, "Error 404, Page not found, #{response_error(response, params)}" end + end + + def response_error(response, params) + "App Client, #{super(response, params)}" end def bearer Lifen.configuration.application_access_token end \ No newline at end of file