From 61bffe6996c408e83dddd31ca0bd9779ebaca7ec Mon Sep 17 00:00:00 2001 From: Thijs van Tol <43065692+thijsvtol@users.noreply.github.com> Date: Sat, 12 Aug 2023 00:47:46 +0200 Subject: [PATCH] fix: deprecation of @octokit/request-error `error.code` --- dist/index.js | 2 +- src/main.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index fa110089..00dec81b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -44,7 +44,7 @@ const github = __importStar(__nccwpck_require__(5438)); const util_1 = __nccwpck_require__(3837); /* eslint-disable @typescript-eslint/no-explicit-any */ function hasErrorStatus(error) { - return typeof error.code === 'number'; + return typeof error.status === 'number'; } function getErrorMessage(error) { if (error instanceof Error) diff --git a/src/main.ts b/src/main.ts index 7a367dc7..aa956052 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,7 +4,7 @@ import {inspect} from 'util' /* eslint-disable @typescript-eslint/no-explicit-any */ function hasErrorStatus(error: any): error is {status: number} { - return typeof error.code === 'number' + return typeof error.status === 'number' } function getErrorMessage(error: unknown) {