Skip to content

Commit 6c06cbb

Browse files
committed
Do not show backtrace in prod
While for folks running a self-hosted instance it might be useful to debug, backtraces should not be shown in production for unexpected (unwrapped with SequeceServer::Error class) exceptions.
1 parent 53e7610 commit 6c06cbb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/sequenceserver/routes.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,9 @@ class Routes < Sinatra::Base
291291
error.class.name
292292
end
293293

294-
# If error object has a more_info method, use that. If the error does not
295-
# have more_info, use backtrace.join("\n") as more_info.
296-
if error.respond_to? :more_info
294+
if error.respond_to?(:more_info)
297295
error_data[:more_info] = error.more_info
298-
elsif error.respond_to? :backtrace
296+
elsif error.respond_to?(:backtrace) && !settings.production?
299297
error_data[:more_info] = error.backtrace.join("\n")
300298
end
301299

0 commit comments

Comments
 (0)