Skip to content

Commit

Permalink
update api
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Caceres authored and Javier Caceres committed Nov 15, 2024
1 parent 93c1edb commit 6f3471e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/backend/src/server/api/endpoints/latest-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
};
}
});

0 comments on commit 6f3471e

Please sign in to comment.