Correctly setting the return code
This commit is contained in:
parent
1305046df2
commit
e5a74de831
@ -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 || []);
|
||||
|
Loading…
Reference in New Issue
Block a user