FIX: LocalJumpError : unexpected return (#18114)

This commit is contained in:
Joffrey JAFFEUX 2022-08-27 18:06:56 +02:00 committed by GitHub
parent a0f402a957
commit 6294659022
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -630,12 +630,13 @@ class GroupsController < ApplicationController
.permit(:host, :port, :username, :password, :ssl, :debug)
EmailSettingsValidator.validate_as_user(current_user, "imap", **final_settings.to_h.symbolize_keys)
end
render json: success_json
rescue *EmailSettingsExceptionHandler::EXPECTED_EXCEPTIONS, StandardError => err
return render_json_error(
render_json_error(
EmailSettingsExceptionHandler.friendly_exception_message(err, email_host)
)
end
render json: success_json
end
end