     return items
 }
 
-func DecodeDictionary<Type : ApusDecodable>(v: JSONValue, failOnError: Bool = true) throws -> [String: Type] {
+func DecodeDictionary<Type : ApusDecodable>(v: JSONValue, errorHandler: ((value: JSONValue, error: NSError) throws -> Void)? = nil) throws -> [String: Type] {
     guard let array = v.asDictionary() else {
         throw NSError(domain: "apus-apus", code: 406, userInfo: ["details": "DecodeDictionary - JSONValue is not a JSONDictionary"])
     }

            let (key, item) = spread(try Type.decode(value))
            items[key] = item
        } catch let err as NSError {
            if failOnError {
                throw err
            } else {
                continue
            }
        }
    }

            let item = try Type.decode(value)
            items[key as String] = item
        } catch let err as NSError {
            if let handler = errorHandler {
                try handler(value: value, error: err)
                continue
            } else {
                throw err
            }
        }
    }
