Fix blank screen when trying to copy emoji with a too large file size (#1718)

Fixes #1714
This commit is contained in:
Claire
2022-03-14 17:34:53 +01:00
committed by GitHub
parent 76d6fe63c3
commit 80c4db160e
2 changed files with 6 additions and 0 deletions

View File

@ -35,6 +35,9 @@ module Admin
flash[:alert] = I18n.t('admin.accounts.no_account_selected')
rescue Mastodon::NotPermittedError
flash[:alert] = I18n.t('admin.custom_emojis.not_permitted')
rescue ActiveRecord::RecordInvalid => e
error_message = action_from_button == 'copy' ? 'admin.custom_emojis.batch_copy_error' : 'admin.custom_emojis.batch_error'
flash[:alert] = I18n.t(error_message, message: e.message)
ensure
redirect_to admin_custom_emojis_path(filter_params)
end