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

    static func decode(j: JSONValue) throws -> Self
}

func DecodeArray<Type : ApusDecodable>(v: JSONValue, failOnError: Bool = true) throws -> [Type] {
    guard let array = v.asArray() else {
        throw NSError(domain: "apus-apus", code: 406, userInfo: ["details": "DecodeArray - JSONValue is not a JSONArray"])
    }
    
    var items = [Type]()

    for value in array {
        do {
            let item = try Type.decode(value)
            items.append(item)
        } catch let err as NSError {
            if failOnError {
                throw err
            } else {
                continue
            }
        }
    }

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