diff --git a/modules/renderer/connection/ServerConnection.ts b/modules/renderer/connection/ServerConnection.ts index 5f69b12..47148de 100644 --- a/modules/renderer/connection/ServerConnection.ts +++ b/modules/renderer/connection/ServerConnection.ts @@ -48,10 +48,14 @@ class ErrorCommandHandler extends AbstractCommandHandler { this.handle = handle; } - generateReturnCode(command: string, callback: (result: CommandResult) => void) : string { + generateReturnCode(command: string, callback: (result: CommandResult) => void, returnCode?: string) : string { + if(typeof returnCode === "undefined") { + returnCode = "rt-" + (++this.errorCodeIndex); + } + const listener = { callback: callback, - code: "rt-" + (++this.errorCodeIndex), + code: returnCode, timeout: 0, command: command } as ErrorCodeListener; @@ -334,7 +338,7 @@ export class ServerConnection extends AbstractServerConnection { } else { reject(result); } - }); + }, data[0]["return_code"]); try { this.nativeHandle.send_command(command, data, options.flagset || []);