From 06c890994a7ed0cafe66b8cff706bb6889b7193d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matheus=20Lu=C3=ADs?= Date: Tue, 21 May 2024 14:24:44 -0300 Subject: [PATCH] test: still chasing tbconsumer errors --- .../src/server/api/routers/tb_consumer.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/deepsirius-ui/src/server/api/routers/tb_consumer.ts b/apps/deepsirius-ui/src/server/api/routers/tb_consumer.ts index 3f6cfc4..d2b3d3b 100644 --- a/apps/deepsirius-ui/src/server/api/routers/tb_consumer.ts +++ b/apps/deepsirius-ui/src/server/api/routers/tb_consumer.ts @@ -36,12 +36,14 @@ export const tbConsumerRouter = createTRPCRouter({ .object({ status: z.string(), message: z.string(), + }) .parse(data); throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: error.message, + cause: data, }); } const parsed = TensorboardResponseSchema.parse(data); @@ -61,15 +63,9 @@ export const tbConsumerRouter = createTRPCRouter({ const data: unknown = await res.json(); return data; } catch (e) { - const error = z - .object({ - status: z.string(), - message: z.string(), - }) - .parse(e); throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', - message: error.message, + message: 'Failed to fetch Tensorboard API', cause: e, }); }