Skip to content

Commit ba397bd

Browse files
committed
Refactor error index view to improve message display
- Adjusted the layout of the error index view by modifying the margin of the message container for better spacing. - Enhanced the message display logic to prioritize a more informative description, combining exception class, sample message, and controller action into a single truncated text element.
1 parent a04a03a commit ba397bd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

app/views/errors/index.html.erb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@
224224
<span class="block w-2.5 h-2.5 rounded-full <%= dot_classes.fetch(dot_sev, 'bg-gray-300') %>" title="<%= dot_sev.capitalize %> severity"></span>
225225
</div>
226226
<div class="ml-3 min-w-0">
227-
<div class="flex items-center space-x-2 mb-1 flex-wrap gap-1">
227+
<div class="flex items-center space-x-2 mb-0.5 flex-wrap gap-1">
228228
<span class="text-sm font-medium text-indigo-600">
229229
<%= issue.exception_class %>
230230
</span>
@@ -235,11 +235,11 @@
235235
<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800" title="From Sidekiq/Solid Queue job">Job</span>
236236
<% end %>
237237
</div>
238-
<% if issue.sample_message.present? %>
239-
<div class="text-xs text-gray-600">
240-
<%= truncate(issue.sample_message, length: 80) %>
241-
</div>
242-
<% end %>
238+
<% desc = error_explanation(issue.exception_class) %>
239+
<% short_text = desc.presence || issue.sample_message.presence || issue.controller_action %>
240+
<div class="text-xs text-gray-500 min-w-0 truncate" title="<%= short_text %>">
241+
<%= truncate(short_text.to_s, length: 120) %>
242+
</div>
243243
</div>
244244
</div>
245245
</td>

0 commit comments

Comments
 (0)