Refactor de jwt y base de la bdd de pausas-cancelaciones

This commit is contained in:
2026-04-07 13:20:31 +02:00
parent 1b6da651a6
commit 7d88359263
18 changed files with 465 additions and 164 deletions

View File

@@ -14,7 +14,7 @@ export type Failure<E = Error> = {
*/
export type Result<E, D> = Failure<E> | Success<D>
export async function tryCatch<T>(func: Promise<T>): Promise<Result<{ msg: Error }, T>> {
export async function tryCatch<T>(func: Promise<T>): Promise<Result<Error, T>> {
try {
const res = await func;
return {
@@ -22,9 +22,8 @@ export async function tryCatch<T>(func: Promise<T>): Promise<Result<{ msg: Error
}
} catch (e: unknown) {
return {
error: {
msg: e as Error
}
error: e as Error
}
}
}