diff --git a/app/Devnull/ErrorCode.php b/app/Devnull/ErrorCode.php index 48da7aa8..00166fee 100644 --- a/app/Devnull/ErrorCode.php +++ b/app/Devnull/ErrorCode.php @@ -24,7 +24,8 @@ enum ErrorCode: string case OwnCommit = 'own_commit'; case CommitUnavailable = 'commit_unavailable'; case GitHubSyncFailed = 'github_sync_failed'; - case GitHubIssueFailed = 'github_issue_failed'; + case GitHubIssueRefused = 'github_issue_refused'; + case GitHubIssueUnanswered = 'github_issue_unanswered'; case PasteisExhausted = 'pasteis_exhausted'; /** @@ -48,7 +49,7 @@ public function message(): ?string self::CommitUnavailable => "fatal: this commit isn't available.", self::GitHubSyncFailed => 'Could not sync from GitHub. Try again in a minute.', self::PasteisExhausted => Pasteis::Exhausted, - self::RateLimited, self::OwnCommit, self::GitHubIssueFailed => null, + self::RateLimited, self::OwnCommit, self::GitHubIssueRefused, self::GitHubIssueUnanswered => null, }; } } diff --git a/tests/Feature/Screens/IssueCommandsTest.php b/tests/Feature/Screens/IssueCommandsTest.php index d09611d4..1d57f2c9 100644 --- a/tests/Feature/Screens/IssueCommandsTest.php +++ b/tests/Feature/Screens/IssueCommandsTest.php @@ -278,8 +278,8 @@ function hasRef(TestableComponent $screen, string $ref): bool ->and(app(Stash::class)->get($this->userId, 'commit')->body)->toBe('Broken.'); })->with([ 'over the limit' => [[['message' => 'Issue limit reached. Try again in an hour.', 'code' => 'rate_limited'], 429], 'Issue limit reached. Try again in an hour.'], - 'GitHub said no' => [[['message' => 'GitHub did not create the issue. Your draft is safe.', 'code' => 'github_issue_failed'], 503], 'GitHub did not create the issue. Your draft is safe.'], - 'GitHub did not answer' => [[['message' => 'GitHub did not respond. Check the upstream issues before trying again. Your draft is safe.', 'code' => 'github_issue_failed'], 503], 'GitHub did not respond. Check the upstream issues before trying again. Your draft is safe.'], + 'GitHub said no' => [[['message' => 'GitHub did not create the issue. Your draft is safe.', 'code' => 'github_issue_refused'], 502], 'GitHub did not create the issue. Your draft is safe.'], + 'GitHub did not answer' => [[['message' => 'GitHub did not respond. Check the upstream issues before trying again. Your draft is safe.', 'code' => 'github_issue_unanswered'], 502], 'GitHub did not respond. Check the upstream issues before trying again. Your draft is safe.'], "a proxy's error page" => [['