14
15
16
17
18
19
20
|
# File 'lib/terrific/mappable.rb', line 14
def map_error(*klasses, options)
rescue_from *klasses do |exception|
status = options.fetch(:to)
error = Error.new(exception, options.slice(:type, :message))
render status: status, json: { error: error }
end
end
|