Module: CommandTower::Workflows::Auth::SignupErrorStatus
- Defined in:
- app/workflows/command_tower/workflows/auth/signup_error_status.rb
Overview
Shared HTTP status mapping for the signup cluster only. Scoped deliberately narrow: a platform-wide error mapping table would let unrelated products silently inherit signup's status choices.
Class Method Summary collapse
Class Method Details
.http_status_for(error) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/workflows/command_tower/workflows/auth/signup_error_status.rb', line 12 def http_status_for(error) case error when CommandTower::Errors::Auth::SignupSessionMissingError, CommandTower::Errors::Auth::SignupSessionInvalidError, CommandTower::Errors::Auth::SignupSessionExpiredError :unauthorized when CommandTower::Errors::Auth::SignupSessionRateLimitError, CommandTower::Errors::Auth::SignupIpRateLimitError :too_many_requests when CommandTower::Errors::Auth::EmailAlreadyRegisteredError, CommandTower::Errors::ValidationError :unprocessable_entity else :internal_server_error end end |