mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 13:06:22 +00:00
enviar los reportes
This commit is contained in:
parent
39fc094790
commit
65af7da0fb
3 changed files with 14 additions and 12 deletions
|
@ -12,25 +12,25 @@ class BacktraceJob < ApplicationJob
|
|||
@site_id = site_id
|
||||
@params = params
|
||||
|
||||
return if files.empty?
|
||||
unless files.empty?
|
||||
params['errors'].each do |error|
|
||||
error['backtrace'].each do |backtrace|
|
||||
offset = SourceMap::Offset.new(backtrace['line'], backtrace['column'])
|
||||
mapping = sourcemap.bsearch(offset)
|
||||
|
||||
params['errors'].each do |error|
|
||||
error['backtrace'].each do |backtrace|
|
||||
offset = SourceMap::Offset.new(backtrace['line'], backtrace['column'])
|
||||
mapping = sourcemap.bsearch(offset)
|
||||
next unless mapping
|
||||
|
||||
next unless mapping
|
||||
|
||||
backtrace['file'] = mapping.source
|
||||
backtrace['line'] = mapping.original.line
|
||||
backtrace['column'] = mapping.original.column
|
||||
backtrace['file'] = mapping.source
|
||||
backtrace['line'] = mapping.original.line
|
||||
backtrace['column'] = mapping.original.column
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
raise BacktraceException, params['errors']&.first&.dig('message')
|
||||
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
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<% unless @data[:_backtrace] %>
|
||||
```
|
||||
<%= raw @backtrace.join("\n") %>
|
||||
```
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<% if @data['backtrace'] %>
|
||||
<% if @data[:_backtrace] %>
|
||||
<% @data.dig(:params, 'errors')&.each do |error| %>
|
||||
# <%= error['type'] %>: <%= error['message'] %>
|
||||
|
||||
|
|
Loading…
Reference in a new issue