refactor: simplify error handling

This commit is contained in:
Shivam Mishra
2025-06-09 15:36:46 +05:30
parent a6e28b71d1
commit f7e3c2a19a
4 changed files with 21 additions and 29 deletions
-21
View File
@@ -1,21 +0,0 @@
# frozen_string_literal: true
module CustomExceptions::OAuth
class InsufficientScopes < CustomExceptions::Base
def message
I18n.t('errors.oauth.insufficient_scopes', scopes: @data[:missing_scopes].join(', '))
end
def code
'SCOPE_ERR'
end
def to_hash
{
message: message,
code: code,
missing_scopes: @data[:missing_scopes]
}
end
end
end