UBERF-8856: Fix space security query and schema update (#7413)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2024-12-10 16:37:59 +07:00
committed by GitHub
parent f1dbf21146
commit cb9720f340
20 changed files with 106 additions and 111 deletions
+7 -1
View File
@@ -106,7 +106,13 @@ export class RPCHandler {
const decoder = new TextDecoder()
_data = decoder.decode(_data)
}
return JSON.parse(_data.toString(), receiver)
try {
return JSON.parse(_data.toString(), receiver)
} catch (err: any) {
if (((err.message as string) ?? '').includes('Unexpected token')) {
return this.packr.unpack(new Uint8Array(data))
}
}
}
return this.packr.unpack(new Uint8Array(data))
}