FRONTEND
Astro v0.21.0
RESUMEN
Minor Changes - #16289 `5d580c0` Thanks @maxmalkin! - Adds a new `getDbError()` helper exported from `astro:db`. It walks the
Descripción Detallada
Minor Changes - #16289 `5d580c0` Thanks @maxmalkin! - Adds a new `getDbError()` helper exported from `astro:db`. It walks the error `.cause` chain and returns the underlying `LibsqlError`, or `undefined` if the error did not originate from libSQL. This is needed because `drizzle-orm` 0.44+ wraps query errors in a `DrizzleQueryError` whose `.cause` is the real `LibsqlError`. #### Upgrading Code that reads `.code` or `.message` after catching a database error should migrate from `isDbError()` to `getDbError()`: ```ts // Before import { isDbError } from 'astro:db'; try { await db.insert(MyTable).values({ ... }); } catch (e) { if (isDbError(e)) { console.error(e.code, e.message); } } // After import { getDbError } from 'astro:db'; try { await db.insert(MyTable).values({ ... }); } catch (e) { const dbError = getDbError(e); if (dbError) { console.error(dbError.code, dbError.message); } } ``` `isDbError()` is still exported and still returns `true` for wrapped errors, but its return type is now `boolean` instead of the `err is LibsqlError` type predicate. Code that relied on the narrowing to access `.code` or `.message` directly will now produce a TypeScript error pointing you to `getDbError
Se añade un nuevo helper `getDbError()` para manejar errores de base de datos.
- Nuevo helper `getDbError()` en `astro:db` para obtener el error subyacente de libSQL.
- `isDbError()` sigue disponible, pero su tipo de retorno cambió a booleano.
A quién le importa
Si trabajas con errores de base de datos en Astro.
Generado por IA · puede contener errores
Releases Relacionados
FRONTEND
Astro v6.4.8
### Patch Changes - [#17109](https://github.com/withastro/astro/pull/17109) [`27c80ea`](https://github.com/withastro/astro/commit/27c80ea92248993e5fce94b2c26d87d611ab6785) Thanks [@ematipico](https://github.com/ematipico)! - Harden the limits on the number of decoding on the URL.
FRONTEND
Astro v6.4.7
### Patch Changes - [#17035](https://github.com/withastro/astro/pull/17035) [`197e50e`](https://github.com/withastro/astro/commit/197e50e2e37168a9b9e8a014c13d1308b2220ca1) Thanks [@astrobot-houston](https://github.com/astrobot-houston)! - Fixes `getRelativeLocaleUrl`, `getAbsoluteLocaleUrl`, and