class ViewModel::DeserializationError::DatabaseConstraint
def self.from_exception(exception, nodes = [])
do our best to parse out what metadata we can from the error, and fall
Database constraint errors are pretty opaque and stringly typed. We can
def self.from_exception(exception, nodes = []) case exception.cause when PG::UniqueViolation, PG::ExclusionViolation UniqueViolation.from_postgres_error(exception.cause, nodes) else self.new(exception.message, nodes) end end
def initialize(detail, nodes = [])
def initialize(detail, nodes = []) @detail = detail super(nodes) end