 	case methodNotFound = 14
 	case notSerever = 15
 	case internalError = 16
+	case invalidSignature = 17
 }


public class ConnectionError: Error, LocalizedError {
	
	public typealias Code = ConnectionErrorCode
	
	public init(code: Code, description: String? = nil) {
		self.code = code
		self.errorDescription = description ?? ConnectionError.defaultMessages[code.rawValue]
	}
	
	public var code: Code
	public var errorDescription: String?
	
	internal var asObject: AnyObject {
		return ["code": code.rawValue, "message": localizedDescription] as AnyObject
	}
	
	internal static func withObject(_ object: Any?) -> ConnectionError? {
		guard let data = object  as? [Any],
		      let code = data[0] as? Int,
		      let errorCode = Code(rawValue: code) else {
			return nil
		}
		return ConnectionError(code: errorCode, description: data[safe: 1] as? String)
	}
	
	// MARK: -

	
}

public enum ConnectionErrorType: Int {
	case appNotFound = 10
	case authFailed = 11
	case interfaceNotFound = 12
