All packages
Git for Laravel
Errors & exceptions
The package’s own exceptions live in RoundlyConsulting\Git\Exceptions; everything else is Laravel’s own:
| Exception | Thrown when |
|---|---|
InvalidCredentialsException | A 401 (no credential, or the forge rejected it) — also while minting an installation token or refreshing an OAuth token; an unsupported or wrong credential type; a missing app/OAuth config key; a non-numeric app, installation or repository id; an empty installation scope; an installation that can’t mint (404/422); a missing app permission on repository creation. |
FeatureNotSupportedException | You call something the provider doesn’t support — check supports() first. Also a Bitbucket commit query filtered by author(), since() or until(). |
RateLimitExceededException | The client-side limiter would have to wait longer than max_wait; carries retryAfterSeconds() via HasRetryAfter. |
BatchRequestException | throwOnError() on a BatchResult with failed keys; ->errors holds each BatchError. |
OutOfScopeException | An argument could leave its scope — a path with ., .. or empty segments, ?, #, \ or a NUL byte (also once percent-decoded), a pull request number below 1, a webhook id not in the forge’s shape, a repository from another provider. Thrown by handles, flat driver methods and batch() alike. Extends InvalidArgumentException; nothing is sent. |
Illuminate\Http\Client\RequestException | Every other refusal — 403, 404, 405, 409, 422, 429, 5xx — with the status on $e->response. |
InvalidArgumentException | An input DTO fails validation, a page size is below 1, a webhook URL can’t be derived, a GitLab comment has no target, GitLab gets a webhook event it has no flag for, or a GitLab owner isn’t a numeric namespace id. |
RoundlyConsulting\PackageToolkit\Exceptions\InvalidConfigurationException | A config value is present but unusable — an integer outside its range, a boolean outside 1/true/on/yes and 0/false/off/no, an unknown timespan, a non-string string setting, a non-string app id. The message names the key; only a key that is not set — absent, null or blank — takes its default. |
HTTP statuses
- 401 — InvalidCredentialsException: “requires authentication” with no credential, “rejected the credential” when the forge refused it. The forge’s RequestException is getPrevious().
- 403, 404, 405, 409, 422, 429, 5xx — RequestException with the status on $e->response. A private repository is a 404 to a caller without access; a throttled 403 or 429 stays retryable.
- GitHub App mints and OAuth refreshes — a 401 (a revoked or wrong app key, a refused refresh) becomes InvalidCredentialsException, as does a 404 or 422 while minting an installation token; a 403 stays a RequestException so a throttled minute never marks a working connection as broken.
Show your open-source love
This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.
More ways to support, including cryptoBy donating, you agree to our donation terms.
Want this built into your product?
We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.