Skip to content

Commit

Permalink
* index.rb, update.rb: return status 500 on error. thanks Masahiro S…
Browse files Browse the repository at this point in the history
…akai.

git-svn-id: https://tdiary.svn.sourceforge.net/svnroot/tdiary/trunk/core@2630 7f22e88f-374d-0410-998f-c91420d97ba2
  • Loading branch information
tadatadashi committed May 26, 2006
1 parent c2a8d4d commit 5fcb7a0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2006-05-26 TADA Tadashi <sho@spc.gr.jp>
* index.rb, update.rb: return status 500 on error. thanks Masahiro Sakai.

2006-05-24 Kazuhiko <kazuhiko@fdiary.net>
* misc/style/etdiary/etdiary_style.rb: remove debug code.

Expand Down
14 changes: 11 additions & 3 deletions index.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
# index.rb $Revision: 1.30 $
# index.rb $Revision: 1.31 $
#
# Copyright (C) 2001-2003, TADA Tadashi <sho@spc.gr.jp>
# You can redistribute it and/or modify it under GPL2.
Expand Down Expand Up @@ -102,12 +102,20 @@
end
rescue Exception
if @cgi then
print @cgi.header( 'type' => 'text/plain' )
if /MSIE/ =~ @cgi.user_agent then
print @cgi.header( 'type' => 'text/html' )
else
print @cgi.header( 'status' => '500 Internal Server Error', 'type' => 'text/html' )
end
else
print "Content-Type: text/plain\n\n"
print "Status: 500 Internal Server Error\n"
print "Content-Type: text/html\n\n"
end
puts "<h1>500 Internal Server Error</h1>"
puts "<pre>"
puts "#$! (#{$!.class})"
puts ""
puts $@.join( "\n" )
puts "</pre>"
end

4 changes: 2 additions & 2 deletions tdiary.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=begin
== NAME
tDiary: the "tsukkomi-able" web diary system.
tdiary.rb $Revision: 1.272 $
tdiary.rb $Revision: 1.273 $
Copyright (C) 2001-2005, TADA Tadashi <sho@spc.gr.jp>
You can redistribute it and/or modify it under GPL2.
=end

TDIARY_VERSION = '2.1.4.20060513'
TDIARY_VERSION = '2.1.4.20060526'

require 'cgi'
require 'uri'
Expand Down
12 changes: 10 additions & 2 deletions update.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
#
# update.rb $Revision: 1.18 $
# update.rb $Revision: 1.19 $
#
# Copyright (C) 2001-2003, TADA Tadashi <sho@spc.gr.jp>
# You can redistribute it and/or modify it under GPL2.
Expand Down Expand Up @@ -89,12 +89,20 @@

rescue Exception
if @cgi then
print @cgi.header( 'type' => 'text/plain' )
if /MSIE/ =~ @cgi.user_agent then
print @cgi.header( 'type' => 'text/html' )
else
print @cgi.header( 'status' => '500 Internal Server Error', 'type' => 'text/html' )
end
else
print "Status: 500 Internal Server Error\n"
print "Content-Type: text/plain\n\n"
end
puts "<h1>500 Internal Server Error</h1>
puts "<pre>"
puts "#$! (#{$!.class})"
puts ""
puts $@.join( "\n" )
puts "</pre>"
end

0 comments on commit 5fcb7a0

Please sign in to comment.