chore: remove unused errors

This commit is contained in:
Shivam Mishra
2025-06-02 20:30:06 +05:30
parent c5cc972a74
commit 3197fafad1
3 changed files with 1 additions and 56 deletions
@@ -39,7 +39,7 @@ class Google::CallbacksController < OauthCallbackController
ChatwootExceptionTracker.new(exception).capture_exception
error_code = exception.respond_to?(:code) ? exception.code : 'OAUTH_ERR'
error_message = exception.message || 'OAuth authorization failed'
error_message = exception.message || I18n.t('errors.oauth.authorization_failed', provider: 'Google')
redirect_url = "#{ENV.fetch('FRONTEND_URL', 'http://localhost:3000')}/app/accounts/#{account.id}/settings/inboxes/new/email"
redirect_to "#{redirect_url}?error=#{CGI.escape(error_message)}&code=#{error_code}"
-2
View File
@@ -51,8 +51,6 @@ en:
oauth:
insufficient_scopes: 'Insufficient permissions granted. Missing scopes: %{scopes}'
authorization_failed: 'Authorization failed for %{provider}'
token_exchange_failed: 'Failed to exchange authorization code for %{provider}'
invalid_state: 'Invalid or missing state parameter'
data_import:
data_type:
invalid: Invalid data type
-53
View File
@@ -18,57 +18,4 @@ module CustomExceptions::OAuth
}
end
end
class AuthorizationFailed < CustomExceptions::Base
def message
I18n.t('errors.oauth.authorization_failed', provider: @data[:provider])
end
def code
'AUTH_ERR'
end
def to_hash
{
message: message,
code: code,
provider: @data[:provider]
}
end
end
class TokenExchangeFailed < CustomExceptions::Base
def message
I18n.t('errors.oauth.token_exchange_failed', provider: @data[:provider])
end
def code
'TOKEN_ERR'
end
def to_hash
{
message: message,
code: code,
provider: @data[:provider]
}
end
end
class InvalidState < CustomExceptions::Base
def message
I18n.t('errors.oauth.invalid_state')
end
def code
'STATE_ERR'
end
def to_hash
{
message: message,
code: code
}
end
end
end