     public init(_ any: Any) {
         wrapped = any
     }
+    
+    internal init(error: ErrorType) {
+        self.wrapped = ()
+        self.error = error
+    }
 }
 
 // Private helpers
 extension JSONValue {
     private func asArray() throws -> [JSONValue] {
+        try throwIfError()
         guard let objectArray = self.wrapped as? [AnyObject] else {
             throw JSONError(.IncompatibleType(typename: "array"), json: self)
         }


public struct JSONValue {
    internal var wrapped: Any
    
    /// Initialize a `JSONValue` by parsing the given `NSData`
    public init(parse data: NSData) throws {

    /// Throws a `JSONError` if the receiver does not wrap a value that can be converted into  an
    /// array of the desired type.
    public func decode<T: JSONDecodable>() throws -> [T] {
        try throwIfError()
        return try self.asArray().map(T.decode)
    }
}
