From 4016c2c380920fb26ea55f22aad1d274898ef6c4 Mon Sep 17 00:00:00 2001 From: DmitryAstafyev Date: Wed, 23 Oct 2024 14:54:37 +0200 Subject: [PATCH] Fix error decoding on ts-binding --- .../apps/rustcore/ts-bindings/src/api/session.provider.ts | 2 +- application/apps/rustcore/ts-bindings/src/interfaces/errors.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/apps/rustcore/ts-bindings/src/api/session.provider.ts b/application/apps/rustcore/ts-bindings/src/api/session.provider.ts index b30fd394b..b62992fe4 100644 --- a/application/apps/rustcore/ts-bindings/src/api/session.provider.ts +++ b/application/apps/rustcore/ts-bindings/src/api/session.provider.ts @@ -190,7 +190,7 @@ export class EventProvider extends Computation< SearchValuesUpdated: new Subject(), SearchMapUpdated: new Subject(), IndexedMapUpdated: new Subject(), - Progress: new Subject(), + Progress: new Subject(), // This even isn't used. No listeners on ts side and never fires on rs side AttachmentsUpdated: new Subject(), SessionError: new Subject(), OperationError: new Subject(), diff --git a/application/apps/rustcore/ts-bindings/src/interfaces/errors.ts b/application/apps/rustcore/ts-bindings/src/interfaces/errors.ts index 6ffc1cb02..44e06e14a 100644 --- a/application/apps/rustcore/ts-bindings/src/interfaces/errors.ts +++ b/application/apps/rustcore/ts-bindings/src/interfaces/errors.ts @@ -147,7 +147,7 @@ export class NativeError extends Error { try { if (smth instanceof Error) { return new NativeError(smth, Type.Other, Source.Other); - } else if (smth instanceof Array) { + } else if (smth instanceof Array || smth instanceof Buffer) { const deserialized: ty.ComputationError = proto.ComputationError.decode( Uint8Array.from(smth), );