From 6f3471e21943e0b5f325b2b284ffa0d9ff6354c1 Mon Sep 17 00:00:00 2001 From: Javier Caceres Date: Fri, 15 Nov 2024 10:21:24 -0600 Subject: [PATCH] update api --- .../src/server/api/endpoints/latest-version.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/latest-version.ts b/packages/backend/src/server/api/endpoints/latest-version.ts index 526b89b..0584248 100644 --- a/packages/backend/src/server/api/endpoints/latest-version.ts +++ b/packages/backend/src/server/api/endpoints/latest-version.ts @@ -16,7 +16,17 @@ export const paramDef = { } as const; export default define(meta, paramDef, async () => { - return { - latest_version: await latestVersion(), - }; + try { + // Intenta obtener la última versión + const version = await latestVersion(); + return { + latest_version: version, + }; + } catch (error) { + // Manejo de errores detallado + console.error("Error al obtener la última versión:", error); + return { + error: "Failed to retrieve the latest version. Please try again later.", + }; + } });