Avoid hitting a deprecation warning when encountering errors from @octokit/request-error (#461)

* fix: use status when http err

* tweak code

* add changeset

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
This commit is contained in:
Younsang Na
2025-05-11 11:15:02 +02:00
committed by GitHub
co-authored by Mateusz Burzyński
parent c1f57e52f9
commit e9c36b6964
3 changed files with 40 additions and 35 deletions
+9
View File
@@ -96,3 +96,12 @@ export function sortTheThings(
}
return -1;
}
export function isErrorWithCode(err: unknown, code: string) {
return (
typeof err === "object" &&
err !== null &&
"code" in err &&
err.code === code
);
}