Make the quota error message friendlier
This commit is contained in:
@@ -8,7 +8,7 @@ class Conversations::MessagesController < ApplicationController
|
||||
def create
|
||||
@conversation.ask(question, **message_params)
|
||||
rescue Ai::Quota::UsageExceedsQuotaError
|
||||
render json: { error: "You've asked too many questions this week" }, status: :too_many_requests
|
||||
render json: { error: "You've depleted your quota" }, status: :too_many_requests
|
||||
rescue Conversation::InvalidStateError
|
||||
render json: { error: "Fizzy is still working on an answer to your last question" }, status: :conflict
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user