parent
71ac440c82
commit
62d663e2c1
@ -0,0 +1,21 @@
|
||||
module CartoGearsApi
|
||||
module Errors
|
||||
# Thrown when an object could not be found in the database
|
||||
class RecordNotFound < StandardError
|
||||
def initialize(object)
|
||||
super("Could not find #{object.class.name.split('::').last} with id #{object.id}")
|
||||
end
|
||||
end
|
||||
|
||||
# Thrown when trying to set invalid values for an object
|
||||
class ValidationFailed < StandardError
|
||||
# @return [Hash<String, Array<String>>] A hash with incorrect attributes as keys and array of messages as values
|
||||
attr_reader :errors
|
||||
|
||||
def initialize(errors)
|
||||
super(errors)
|
||||
@errors = errors
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue