mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FIX: Don't render error for bad-sequence (#21187)
We are seeing issues with the composer not being able to close due to the addition of a error message when rescuing from `Draft::OutOfSequence`. This PR will revert to the original solution implemented prior to https://github.com/discourse/discourse/pull/21148 that just silently rescues from `Draft::OutOfSequence`
This commit is contained in:
@ -100,8 +100,9 @@ class DraftsController < ApplicationController
|
||||
|
||||
begin
|
||||
Draft.clear(user, params[:id], params[:sequence].to_i)
|
||||
rescue Draft::OutOfSequence => e
|
||||
return render json: failed_json.merge(errors: e), status: 404
|
||||
rescue Draft::OutOfSequence
|
||||
# nothing really we can do here, if try clearing a draft that is not ours, just skip it.
|
||||
# rendering an error causes issues in the composer
|
||||
rescue StandardError => e
|
||||
return render json: failed_json.merge(errors: e), status: 401
|
||||
end
|
||||
|
Reference in New Issue
Block a user