Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/quick_actions/command_definition.rb')
-rw-r--r--lib/gitlab/quick_actions/command_definition.rb18
1 files changed, 15 insertions, 3 deletions
diff --git a/lib/gitlab/quick_actions/command_definition.rb b/lib/gitlab/quick_actions/command_definition.rb
index fcb7bc967ca..d9135d1bacb 100644
--- a/lib/gitlab/quick_actions/command_definition.rb
+++ b/lib/gitlab/quick_actions/command_definition.rb
@@ -89,17 +89,29 @@ module Gitlab
def to_h(context)
desc = description
if desc.respond_to?(:call)
- desc = context.instance_exec(&desc) rescue ''
+ desc = begin
+ context.instance_exec(&desc)
+ rescue StandardError
+ ''
+ end
end
warn = warning
if warn.respond_to?(:call)
- warn = context.instance_exec(&warn) rescue ''
+ warn = begin
+ context.instance_exec(&warn)
+ rescue StandardError
+ ''
+ end
end
prms = params
if prms.respond_to?(:call)
- prms = Array(context.instance_exec(&prms)) rescue params
+ prms = begin
+ Array(context.instance_exec(&prms))
+ rescue StandardError
+ params
+ end
end
{