 			return Response.help(topic: topic, paths: paths)
 		case "error":
 			guard let code = json["errorCode"] as? Int else { throw ComputeError.invalidFormat }
-			return Response.error(ErrorData(code: code, details: json["errorDetails"] as? String, transactionId: transId))
+			let ecode = SessionErrorCode(rawValue: code) ?? SessionErrorCode.unknown
+			return Response.error(ErrorData(code: ecode, details: json["errorDetails"] as? String, transactionId: transId))
 		default:
 			Log.logger.error(message: "unknown response from compute engine: \(msg)", true)
 			throw ComputeError.invalidFormat


import Foundation
import PerfectLib

/// object to transform data send/received from the compute engine
class ComputeCoder {

	}
	
	struct ErrorData {
		let code: SessionErrorCode
		let details: String?
		let transactionId: String?
	}
