     case FailedToGetNumber(Any, JAYSON)
     case FailedToGetArray(Any, JAYSON)
     case InvalidJSONObject
+    case DecodeError(Any, JAYSON, Error)
 }
 
 public struct JAYSON: CustomDebugStringConvertible {

        return try getNumber().intValue
    }
    
    public func getString() throws -> String {
        guard let value = source as? String else {
            throw JAYSONError.FailedToGetString(source, self)

extension JAYSON {

    public func get<T>(_ s: (JAYSON) throws -> T) rethrows -> T {
        do {
            return try s(self)
        } catch {
            throw JAYSONError.DecodeError(source, self, error)
        }
    }
    
    public func get<T>(with decoder: Decoder<T>) throws -> T {
        do {
            return try decoder.decode(self)
        } catch {
            throw JAYSONError.DecodeError(source, self, error)
        }
    }
}

