unified error handling system
This commit is contained in:
0
app/views/static/error.atom.erb
Normal file
0
app/views/static/error.atom.erb
Normal file
5
app/views/static/error.html.erb
Normal file
5
app/views/static/error.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<% if @error_message %>
|
||||
<p><%= @error_message %></p>
|
||||
<% else %>
|
||||
<p>Error: <%= @exception.to_s %></p>
|
||||
<% end %>
|
||||
5
app/views/static/error.json.erb
Normal file
5
app/views/static/error.json.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<% if @error_message %>
|
||||
{success: false, message: <%= raw @error_message.to_json %>}
|
||||
<% else %>
|
||||
{success: false, message: <%= raw @exception.to_s.to_json %>}
|
||||
<% end %>
|
||||
6
app/views/static/error.xml.erb
Normal file
6
app/views/static/error.xml.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<% if @error_message %>
|
||||
<result success="false"><%= @error_message %></result>
|
||||
<% else %>
|
||||
<result success="false"><%= @exception.to_s %></result>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user