remove unsupported syntax

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-04-20 14:22:37 -06:00
parent 9026d5e0d6
commit e89b7cba11
1 changed files with 4 additions and 3 deletions

View File

@ -58,10 +58,11 @@ class SynologyError extends GrpcError {
this.httpCode = httpCode;
if (code > 0) {
const error = SYNO_ERRORS[code];
this.code = error?.status ?? grpc.status.UNKNOWN;
this.code = error && error.status ? error.status : grpc.status.UNKNOWN;
this.message =
error?.message ??
`An unknown error occurred when executing a synology command (code = ${code}).`;
error && error.message
? error.message
: `An unknown error occurred when executing a synology command (code = ${code}).`;
} else {
this.code = grpc.status.UNKNOWN;
this.message = `The synology webserver returned a status code ${httpCode}`;