diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-08-01 16:55:50 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-08-01 22:10:04 +0200 |
commit | 0720b9ce0059feca284404e6fc1ede0cba542fe3 (patch) | |
tree | db60fc44c3c3b9c29ee27a41570f75c40953e007 /lib/gitlab/request_profiler | |
parent | 0819461e84d2652d66be070cb758c42b3d8d6858 (diff) | |
download | gitlab-ce-0720b9ce0059feca284404e6fc1ede0cba542fe3.tar.gz |
Catch what warden might throw when profiling requests to re-throw itfix/request-profiler-error-when-unauthenticated
Closes #20488
Diffstat (limited to 'lib/gitlab/request_profiler')
-rw-r--r-- | lib/gitlab/request_profiler/middleware.rb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/gitlab/request_profiler/middleware.rb b/lib/gitlab/request_profiler/middleware.rb index 0c54f2dd71f..4e787dc0656 100644 --- a/lib/gitlab/request_profiler/middleware.rb +++ b/lib/gitlab/request_profiler/middleware.rb @@ -29,7 +29,9 @@ module Gitlab def call_with_profiling(env) ret = nil result = RubyProf::Profile.profile do - ret = @app.call(env) + ret = catch(:warden) do + @app.call(env) + end end printer = RubyProf::CallStackPrinter.new(result) @@ -41,7 +43,11 @@ module Gitlab printer.print(file) end - ret + if ret.is_a?(Array) + ret + else + throw(:warden, ret) + end end end end |