class Shaf::Errors::ValidationError
Attributes
fields[R]
Public Class Methods
from_sequel(validation_failed)
click to toggle source
# File lib/shaf/errors.rb, line 115 def self.from_sequel(validation_failed) new(validation_failed.message, validation_failed.errors).tap do |err| err.set_backtrace(validation_failed.backtrace) end end
new(msg, fields)
click to toggle source
Calls superclass method
Shaf::Errors::ServerError::new
# File lib/shaf/errors.rb, line 125 def initialize(msg, fields) msg ||= "The entity being created/updated is invalid" super(msg, code: "VALIDATION_ERROR", title: "Invalid entity") @fields = fields || {} end
Public Instance Methods
http_status()
click to toggle source
# File lib/shaf/errors.rb, line 121 def http_status 422 end