Method: Landline::Util.default_error_page
- Defined in:
- lib/landline/util/html.rb
.default_error_page(code, backtrace) ⇒ String
Default error page for Landline
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/landline/util/html.rb', line 89 def self.default_error_page(code, backtrace) backtrace ||= [] errortext = HTTP_STATUS[code] " <!DOCTYPE HTML>\n <html>\n <head>\n <title>\#{Util.escape_html(errortext)}</title>\n <style> .header {padding: 0.5rem; overflow: auto;} .title { font-weight: bolder; font-size: 48px; margin: 10px 10px; text-shadow: 1px 1px 1px #202222, 2px 2px 2px #404444; float: left } body { margin: 0; } .text { font-size 1rem; } .small { color: #7D7D7D; font-size: 12px;} .code { font-family: monospace; font-size: 0.7rem; } </style>\n <meta charset=\"utf-8\">\n </head>\n <body>\n <div class=\"header\">\n <p class=\"title\">Landline</p>\n <p style=\"float: right\"><a href=\"https://adastra7.net/git/yessiest/landline\">Source code</a></p>\n </div>\n <div style=\"padding: 0.5rem\">\n <p class=\"text\">\#{Util.escape_html(errortext)}</p>\n <pre><code class=\"text code\">\n \#{backtrace.map(&Util.method(:escape_html)).join('<br/>')}\n </code></pre>\n <hr/>\n <p class=\"small\">\#{Util.escape_html(Landline::VLINE)}</p>\n </div>\n </body>\n </html>\n HTMLEOF\nend\n" |