mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-26 00:16:22 +00:00
mostrar solo el origen del error
This commit is contained in:
parent
c9e0ce9c38
commit
4b6e43b63d
1 changed files with 8 additions and 1 deletions
|
@ -36,7 +36,7 @@ class BacktraceJob < ApplicationJob
|
||||||
end
|
end
|
||||||
|
|
||||||
begin
|
begin
|
||||||
raise BacktraceException, "#{params.dig('context', 'url')}: #{params['errors']&.first&.dig('message')}"
|
raise BacktraceException, "#{origin}: #{params['errors']&.first&.dig('message')}"
|
||||||
rescue BacktraceException => e
|
rescue BacktraceException => e
|
||||||
ExceptionNotifier.notify_exception(e, data: { site: site.name, params: params, _backtrace: true })
|
ExceptionNotifier.notify_exception(e, data: { site: site.name, params: params, _backtrace: true })
|
||||||
end
|
end
|
||||||
|
@ -95,4 +95,11 @@ class BacktraceJob < ApplicationJob
|
||||||
SourceMap::Map.from_hash data(map)
|
SourceMap::Map.from_hash data(map)
|
||||||
end.reduce(&:+)
|
end.reduce(&:+)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @return [String]
|
||||||
|
def origin
|
||||||
|
URI.parse(params.dig('context', 'url')).host
|
||||||
|
rescue URI::Error
|
||||||
|
params.dig('context', 'url')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue