Expose `RequestError` to scripts
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- github, javascript, typescript
調査の方向性
Use the README's Request Error Handling example as the behavioral reference; trace the script-facing API and its public exports to find where RequestError can be made available. Done means scripts can import RequestError and use instanceof for Octokit errors while preserving handling of unrelated errors.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
https://github.com/octokit/octokit.js?tab=readme-ov-file#request-error-handling
import { RequestError } from "octokit"; try { // your code here that sends at least one Octokit request await octokit.request("GET /"); } catch (error) { // Octokit errors are instances of RequestError, so they always have an `error.status` property containing the HTTP response code. if (error instanceof RequestError) { // handle Octokit error // error.message; // Oops // error.status; // 500 // error.request; // { method, url, headers, body } // error.response; // { url, status, headers, data } } else { // handle all other errors throw error; } }
Scripts don't have access to the RequestError class, making error handling a pain.
Describe the solution you'd like
Expose RequestError to the script.
Describe alternatives you've considered
You can skip the instanceof check and access the attribute directly (e.g. error.status) but this is approach is very imprecise and error-prone.
- 主要言語
- TypeScript
- スター
- 5k
- フォーク
- 586
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
actions/github-script のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
actions/github-script#728 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
actions/github-script#727 · リアクション 1 件 ·
-
{ オープン
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
actions/github-script#724 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#723 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
actions/github-script#714 · コメント 1 件 · リアクション 4 件 ·
actions/github-script の issue をすべて見る
似ている issue
-
blocklist removal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pastelsky/bundlephobia#1122 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100