File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 11import { z } from "zod" ;
22import { getLatestReleaseFromGitHub } from "../utils/json-data" ;
33import { LocalStorageWithSchema } from "../utils/local-storage-with-schema" ;
4+ import { tryCatch } from "@monkeytype/util/trycatch" ;
5+ import { createErrorMessage } from "../utils/misc" ;
46
57const memoryLS = new LocalStorageWithSchema ( {
68 key : "lastSeenVersion" ,
@@ -20,7 +22,19 @@ function getMemory(): string {
2022}
2123
2224async function check ( ) : Promise < void > {
23- const currentVersion = await getLatestReleaseFromGitHub ( ) ;
25+ const { data : currentVersion , error } = await tryCatch (
26+ getLatestReleaseFromGitHub ( )
27+ ) ;
28+
29+ if ( error ) {
30+ const msg = createErrorMessage (
31+ error ,
32+ "Failed to fetch version number from GitHub"
33+ ) ;
34+ console . error ( msg ) ;
35+ return ;
36+ }
37+
2438 const memoryVersion = getMemory ( ) ;
2539
2640 version = currentVersion ;
You can’t perform that action at this time.
0 commit comments