sendError method
Implementation
void sendError(ErrorType type, int callbackId, int errorCode,
[String? errorMessage]) {
var msg = DC.stringToBytes(errorMessage ?? "");
if (type == ErrorType.Management)
sendParams()
..addUint8(0xC0 | IIPPacketReport.ManagementError)
..addUint32(callbackId)
..addUint16(errorCode)
..done();
else if (type == ErrorType.Exception)
sendParams()
..addUint8(0xC0 | IIPPacketReport.ExecutionError)
..addUint32(callbackId)
..addUint16(errorCode)
..addUint16(msg.length)
..addDC(msg)
..done();
}