website refactor
This commit is contained in:
@@ -101,7 +101,7 @@ export const responseCache = new ResponseCache();
|
||||
export async function withGracefulDegradation<T>(
|
||||
fn: () => Promise<T>,
|
||||
options: DegradationOptions<T> = {}
|
||||
): Promise<T> {
|
||||
): Promise<T | undefined> {
|
||||
const {
|
||||
fallback,
|
||||
throwOnError = false,
|
||||
@@ -139,7 +139,7 @@ export async function withGracefulDegradation<T>(
|
||||
}
|
||||
|
||||
// Return undefined (caller must handle)
|
||||
return undefined as unknown as T;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
// API is available, try to execute
|
||||
@@ -193,7 +193,7 @@ export async function withGracefulDegradation<T>(
|
||||
throw error;
|
||||
}
|
||||
|
||||
return undefined as unknown as T;
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user