aboutsummaryrefslogtreecommitdiff
path: root/error.cgi
diff options
context:
space:
mode:
authorBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-28 15:59:47 +0100
committerBenjamin Kellermann <Benjamin.Kellermann@gmx.de>2010-01-28 15:59:47 +0100
commitf57e493bdd6c81ec4f26d0f2afb715c6581b7d74 (patch)
tree3fc0f63c24d24d8baafa3c7382efa9c33c63f77d /error.cgi
parentf3d51174790a8b8d55de98d5c8f5b06bd36f9382 (diff)
more robust
Diffstat (limited to 'error.cgi')
-rwxr-xr-xerror.cgi24
1 files changed, 17 insertions, 7 deletions
diff --git a/error.cgi b/error.cgi
index c74e80b..bd5cf1b 100755
--- a/error.cgi
+++ b/error.cgi
@@ -19,9 +19,18 @@
# along with dudle. If not, see <http://www.gnu.org/licenses/>. #
############################################################################
-require "dudle"
-
-$d = Dudle.new
+require "cgi"
+$cgi = CGI.new
+require "config"
+require "html"
+
+$h = HTML.new("Error")
+$h.add_css("/default.css","default",true)
+$h << <<END
+<div id='main'>
+<div id='content'>
+<h1>Error</h1>
+END
def urlescape(str)
CGI.escapeHTML(CGI.escape(str).gsub("+","%20"))
@@ -46,7 +55,7 @@ if defined?(ERRORLOG)
errorstr = "Exception while opening #{ERRORLOG}:\n#{e}"
else
s = [a.pop]
- s << a.pop while s.last.scan(/^\[([^\]]*)\] \[/).flatten[0] == a.last.scan(/^\[([^\]]*)\] \[/).flatten[0]
+ s << a.pop while s.last.scan(/^\[([^\]]*)\] \[/).flatten[0] == a.last.scan(/^\[([^\]]*)\] \[/).flatten[0] || a.last =~ /^[^\[]/
errorstr = s.reverse.join
end
@@ -63,7 +72,7 @@ Yours,
MESSAGE
- $d << <<ERROR
+ $h << <<ERROR
An error occured while executing dudle.<br/>
Please report you browser, operating system, and what you did to
<a href='mailto:#{BUGREPORTMAIL}?subject=#{urlescape("Bug in dudle")}&amp;body=#{urlescape(errormessagebody)}'>#{BUGREPORTMAIL}</a>.
@@ -71,11 +80,12 @@ ERROR
if (errorstr)
- $d << <<ERROR
+ $h << <<ERROR
<br/>
Please include the following as well:
<pre style='background:#DDD;padding : 1em'>#{errorstr}</pre>
ERROR
end
-$d.out
+$h << "</div></div>"
+$h.out($cgi)