Sha256: f1c7de2909303e1701df982d757317d3caeba2efcd6920e03a27f684171369a8

Contents?: true

Size: 1.58 KB

Versions: 24

Compression:

Stored size: 1.58 KB

Contents

<%
error = error.is_a?(Lookbook::Error) ? error : Lookbook::Error.new(error)
@title = error.title
%>

<div class="flex flex-col h-screen">
  <div class="h-full bg-red-50 overflow-y-auto">
    <header class="mx-8 py-6">
      <h2 class="text-xl font-bold text-red-700"><%= error.title %></h2>
    </header>

    <div class="flex-none px-8 py-6 mb-8 border-t border-b border-red-200 bg-red-100 text-base font-mono leading-relaxed">
      <pre class="whitespace-pre-wrap font-sans leading-tight text-red-900"><%= error.message %></pre>
    </div>

    <% if error.file_name %>
      <div class="text-sm mx-8 mb-2 font-mono">
        <span><%= error.file_name %></span>
        <% if error.line_number %>
          <span>[line <strong><%= error.line_number %></strong>]</span>
        <% end %>
      </div>
    <% end %>

    <% if error.source_code %>
      <div class="mx-8 border border-red-200 max-w-screen-lg">
        <%= lookbook_render :code,
          language: error.file_lang,
          highlight_lines: [error.source_code[:highlighted_line]],
          start_line: error.source_code[:start_line],
          line_numbers: true do %><%= h(error.source_code[:code]) %><% end %>
      </div>
    <% end %>

    <h3 class="font-bold mb-2 px-8 py-2 mt-8 sticky top-0 bg-red-50">Full stack trace:</h3>
    <div class="text-xs font-mono">
      <div class="px-8 pb-10 text-gray-400 leading-relaxed">
        <% error.backtrace.each do |line| %>
          <div class="hover:text-gray-900 transition-colors duration-100">
            <%= line %>
          </div>
        <% end %>
      </div>
    </div>
  </div>
</div>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
lookbook-1.5.5 app/views/lookbook/error.html.erb
lookbook-1.5.4 app/views/lookbook/error.html.erb
lookbook-2.0.0.beta.3 app/views/lookbook/error.html.erb
lookbook-2.0.0.beta.2 app/views/lookbook/error.html.erb
lookbook-1.5.3 app/views/lookbook/error.html.erb
lookbook-2.0.0.beta.1 app/views/lookbook/error.html.erb
lookbook-1.5.2 app/views/lookbook/error.html.erb
lookbook-2.0.0.beta.0 app/views/lookbook/error.html.erb
lookbook-1.5.1 app/views/lookbook/error.html.erb
lookbook-1.5.0 app/views/lookbook/error.html.erb
lookbook-1.4.5 app/views/lookbook/error.html.erb
lookbook-1.4.4 app/views/lookbook/error.html.erb
lookbook-1.4.3 app/views/lookbook/error.html.erb
lookbook-1.4.2 app/views/lookbook/error.html.erb
lookbook-1.4.1 app/views/lookbook/error.html.erb
lookbook-1.4.0 app/views/lookbook/error.html.erb
lookbook-1.3.4 app/views/lookbook/error.html.erb
lookbook-1.3.3 app/views/lookbook/error.html.erb
lookbook-1.3.1 app/views/lookbook/error.html.erb
lookbook-1.3.0 app/views/lookbook/error.html.erb