         # Using `isEqual` for possibility of placing enums on array and object schemas
         return value if _.isEqual(possibleValue, value)
 
-      throw new Error('Value is not one of the possible values')
+      throw new Error("Cannot set #{keyPath}, #{JSON.stringify(value)} is not one of #{JSON.stringify(possibleValues)}")
 
 isPlainObject = (value) ->
   _.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value)

# specification.
Config.addSchemaValidators
  'integer':
    coercion: (value, schema) ->
      value = parseInt(value)
      throw new Error('Value cannot be coerced into an int') if isNaN(value)
      value

  'number':
    coercion: (value, schema) ->
      value = parseFloat(value)
      throw new Error('Value cannot be coerced into a number') if isNaN(value)
      value

  'boolean':
    coercion: (value, schema) ->
      switch typeof value
        when 'string'
          value.toLowerCase() in ['true', 't']

        value = Math.min(value, schema.maximum)
      value

    enumValidation: (keyPath, value, schema) ->
      possibleValues = schema.enum
      return value unless possibleValues? and Array.isArray(possibleValues) and possibleValues.length

