From e38829bf2d27a93e93344ff1c27825d92907b875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Pi=C4=8Dman?= Date: Tue, 20 Sep 2022 14:06:01 +0200 Subject: [PATCH] Internal error 500 #281 --- app/controllers/custom_workflows_controller.rb | 2 +- app/models/custom_workflow.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/custom_workflows_controller.rb b/app/controllers/custom_workflows_controller.rb index 5a8ca9e..37f42dd 100644 --- a/app/controllers/custom_workflows_controller.rb +++ b/app/controllers/custom_workflows_controller.rb @@ -88,7 +88,7 @@ class CustomWorkflowsController < ApplicationController else flash[:error] = @workflow.errors.full_messages.to_sentence end - rescue => e + rescue Exception => e Rails.logger.warn "Workflow import error: #{e.message}\n #{e.backtrace.join("\n ")}" flash[:error] = l(:error_failed_import) end diff --git a/app/models/custom_workflow.rb b/app/models/custom_workflow.rb index 40c6453..1e315c7 100644 --- a/app/models/custom_workflow.rb +++ b/app/models/custom_workflow.rb @@ -98,7 +98,7 @@ class CustomWorkflow < ActiveRecord::Base Rails.logger.info "== User workflow error: #{e.message}" object.errors.add :base, e.error false - rescue => e + rescue Exception => e Rails.logger.error "== Custom workflow exception: #{e.message}\n #{e.backtrace.join("\n ")}" object.errors.add :base, :custom_workflow_error false @@ -111,7 +111,7 @@ class CustomWorkflow < ActiveRecord::Base def validate_syntax_for(object, event) object.instance_eval(read_attribute(event)) if respond_to?(event) && read_attribute(event) rescue RedmineCustomWorkflows::Errors::WorkflowError => _ - rescue => e + rescue Exception => e errors.add event, :invalid_script, error: e end