Update api-utils.ts

pull/38/head
HarithaVattikuti 2 years ago
parent 0962b68a54
commit 9ff61ccbfa

@ -14,7 +14,7 @@ interface GitRef {
}; };
} }
interface Error { interface ErrorStatus extends Error {
status?: number; status?: number;
} }
@ -30,7 +30,7 @@ async function findTag(
return foundTag; return foundTag;
} catch (err) { } catch (err) {
if ((err as Error).status === 404) { if ((err as ErrorStatus).status === 404) {
return null; return null;
} else { } else {
throw new Error( throw new Error(
@ -70,7 +70,7 @@ export async function validateIfReleaseIsPublished(
); );
} }
} catch (err) { } catch (err) {
if ((err as Error).status === 404) { if ((err as ErrorStatus).status === 404) {
throw new Error(`No GitHub release found for the ${tag} tag`); throw new Error(`No GitHub release found for the ${tag} tag`);
} else { } else {
throw new Error( throw new Error(

Loading…
Cancel
Save