From bf47d102fdb849e755b0b0023ea3e81a44b6f570 Mon Sep 17 00:00:00 2001 From: Thijs van Tol <43065692+thijsvtol@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:57:07 +0200 Subject: [PATCH] fix: deprecation of @octokit/request-error `error.code` (#245) --- 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) {