diff --git a/lib/passwordstate/errors.rb b/lib/passwordstate/errors.rb index 3e3b8ca304b4ef0dcb33eeddeb4f123046876b68..c45fe61a90265b0fa687aee3669b8a4f143600f4 100644 --- a/lib/passwordstate/errors.rb +++ b/lib/passwordstate/errors.rb @@ -23,6 +23,11 @@ module Passwordstate errtype ||= ClientError if code_i >= 400 && code_i < 500 errtype ||= ServerError if code_i >= 500 && code_i < 600 + if code_i == 302 && res['location'].start_with?('/error/generalerror.aspx?') + errtype ||= ServerError + errors = [{ 'phrase' => 'Response code 302, most likely meaning an authorization error' }] + end + errtype ||= HTTPError errtype.new(code_i, req, res, errors) end