Skip to content
Permalink
Browse files

Add 500 error

  • Loading branch information...
sugyan committed Oct 5, 2019
1 parent 4f00f26 commit a8afb24a7ca707e58a1472edf4d87f4e8143d21e
Showing with 6 additions and 0 deletions.
  1. +6 −0 webapp/ruby/app.rb
@@ -1469,6 +1469,7 @@ def halt_with_error(status = 500, message = 'unknown')
rescue Mysql2::Error => e
db.query('ROLLBACK')
puts e.message
puts 'cancel error!!!!!!!!! 1'
halt_with_error 500, '予約情報の検索に失敗しました'
end

@@ -1480,6 +1481,7 @@ def halt_with_error(status = 500, message = 'unknown')
case reservation[:status]
when 'rejected'
db.query('ROLLBACK')
puts 'cancel error!!!!!!!!! 2'
halt_with_error 500, '何らかの理由により予約はRejected状態です'
when 'done'
# 支払いをキャンセルする
@@ -1500,6 +1502,7 @@ def halt_with_error(status = 500, message = 'unknown')
if res.code != '200'
db.query('ROLLBACK')
puts res.code
puts 'cancel error!!!!!!!!! 3'
halt_with_error 500, '決済に失敗しました。支払いIDが間違っている可能性があります'
end

@@ -1509,6 +1512,7 @@ def halt_with_error(status = 500, message = 'unknown')
rescue JSON::ParserError => e
db.query('ROLLBACK')
puts e.message
puts 'cancel error!!!!!!!!! 4'
halt_with_error 500, 'JSON parseに失敗しました'
end

@@ -1526,6 +1530,7 @@ def halt_with_error(status = 500, message = 'unknown')
rescue Mysql2::Error => e
db.query('ROLLBACK')
puts e.message
puts 'cancel error!!!!!!!!! 5'
halt_with_error 500, e.message
end

@@ -1537,6 +1542,7 @@ def halt_with_error(status = 500, message = 'unknown')
rescue Mysql2::Error => e
db.query('ROLLBACK')
puts e.message
puts 'cancel error!!!!!!!!! 6'
halt_with_error 500, e.message
end

0 comments on commit a8afb24

Please sign in to comment.
You can’t perform that action at this time.