From 6294659022e12eaa2e2a2a67bb5ff878c7c1c540 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Sat, 27 Aug 2022 18:06:56 +0200 Subject: [PATCH] FIX: LocalJumpError : unexpected return (#18114) --- app/controllers/groups_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index a5ad225ddb..0bc45d0ddf 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -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