-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stats): improve stats app resiliency
feat: add try catch for stats feat: improve stats app resiliency fix: remove try catch from api fix: avoid to confuse nodeService values fix: add error handling by logging and sentry fix: fix clean code fix: add runOrLog function fix: lint fix: chagne logger name fix: add error handling to node status fix: add logging util feat: improve speed to get stats feat: add scope
- Loading branch information
Showing
6 changed files
with
467 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,8 @@ | |
"provider", | ||
"deployment", | ||
"certificate", | ||
"dx" | ||
"dx", | ||
"stats" | ||
] | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { getSentry } from "@src/core/providers/sentry.provider"; | ||
import { LoggerService } from "@src/core/services/logger/logger.service"; | ||
|
||
export const createLoggingExecutor = (logger: LoggerService) => async <T>(cb: () => Promise<T>, defaultValue?: T): Promise<T> => { | ||
try { | ||
return await cb(); | ||
} catch (error) { | ||
logger.error({ event: `Failed to fetch ${cb.name}`, error }); | ||
getSentry().captureException(error); | ||
return defaultValue; | ||
} | ||
} |
Oops, something went wrong.