Files
danbooru/app/views/static/error.js.erb
evazion 00239c4901 favorites: fix error handling.
* Return HTTP 422 instead of HTTP 500 on "You have already favorited
  this post" errors.

* Log unexpected errors in Ajax requests to the console.
2019-08-13 21:30:20 -05:00

11 lines
299 B
Plaintext

var klass = <%= raw @exception.class.to_s.to_json %>;
var message = <%= raw @message.to_json %>;
var backtrace = <%= raw @backtrace.to_json %>;
<% if @expected %>
Danbooru.Utility.error(message);
<% else %>
console.error(klass, message, backtrace);
Danbooru.Utility.error(message);
<% end %>