Refactor de jwt y base de la bdd de pausas-cancelaciones
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user