mirror of
https://github.com/Start9Labs/start-sdk.git
synced 2026-04-04 14:29:47 +00:00
add health util for error catching
This commit is contained in:
@@ -35,3 +35,9 @@ export const guardDurationAboveMinimum = (
|
|||||||
(input.duration <= input.minimumTime)
|
(input.duration <= input.minimumTime)
|
||||||
? Promise.reject(errorCode(60, "Starting"))
|
? Promise.reject(errorCode(60, "Starting"))
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
export const catchError = (effects: Effects) => (e: unknown) => {
|
||||||
|
const error = (error: string) => ({ error });
|
||||||
|
effects.error(`Health check failed: ${e}`);
|
||||||
|
return error("Error while running health check");
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user