diff options
author | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2021-01-20 22:34:23 +0300 |
commit | 6438df3a1e0fb944485cebf07976160184697d72 (patch) | |
tree | 00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /lib/gitlab/graphql/lazy.rb | |
parent | 42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff) |
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'lib/gitlab/graphql/lazy.rb')
-rw-r--r-- | lib/gitlab/graphql/lazy.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/graphql/lazy.rb b/lib/gitlab/graphql/lazy.rb index 54013cf4790..3563504226c 100644 --- a/lib/gitlab/graphql/lazy.rb +++ b/lib/gitlab/graphql/lazy.rb @@ -17,6 +17,14 @@ module Gitlab self.class.new { yield force } end + def catch(error_class = StandardError, &block) + self.class.new do + force + rescue error_class => e + yield e + end + end + # Force evaluation of a (possibly) lazy value def self.force(value) case value |