Class: Noise::ErrorSerializer
- Inherits:
-
ActiveModel::Serializer
- Object
- ActiveModel::Serializer
- Noise::ErrorSerializer
- Defined in:
- lib/noise/error_serializer.rb
Overview
Generic error serializer
Direct Known Subclasses
Constant Summary collapse
- BUGSNAG_URL =
'https://app.bugsnag.com/{organization}/{project}/errors?filters[event.since][]=30d&filters[user.name][]={id}'
Instance Method Summary collapse
- #attributes ⇒ Object
- #code ⇒ Object
- #fallback_message ⇒ Object
- #id ⇒ Object
- #links ⇒ Object
- #title ⇒ Object
Instance Method Details
#attributes ⇒ Object
19 20 21 22 23 |
# File 'lib/noise/error_serializer.rb', line 19 def attributes(*) data = super data['object'] = 'error' data end |
#code ⇒ Object
29 30 31 |
# File 'lib/noise/error_serializer.rb', line 29 def code code_from_http_status end |
#fallback_message ⇒ Object
45 46 47 |
# File 'lib/noise/error_serializer.rb', line 45 def nil end |
#id ⇒ Object
25 26 27 |
# File 'lib/noise/error_serializer.rb', line 25 def id scope.try(:[], :id) end |
#links ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/noise/error_serializer.rb', line 37 def links { 'about' => { 'href' => bugsnag_search_url.to_s, }, } end |
#title ⇒ Object
33 34 35 |
# File 'lib/noise/error_serializer.rb', line 33 def title 'Internal Server Error' end |