Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions app/Devnull/ErrorCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -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,
};
}
}
4 changes: 2 additions & 2 deletions tests/Feature/Screens/IssueCommandsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" => [['<html><title>502: Bad gateway</title></html>', 502], 'GitHub did not confirm the issue. Check upstream before retrying. Your draft is safe.'],
'a maintenance page with a 200' => [['<html><title>Maintenance - /dev/null</title></html>', 200], "fatal: unable to access 'http://devnull.test': unexpected answer (HTTP 200)"],
'invalid' => [[['message' => 'The body field must not be greater than 4000 characters.', 'errors' => ['body' => ['The body field must not be greater than 4000 characters.']]], 422], 'The body field must not be greater than 4000 characters.'],
Expand Down