allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
20
vendor/spatie/flare-client-php/src/Http/Exceptions/BadResponse.php
vendored
Normal file
20
vendor/spatie/flare-client-php/src/Http/Exceptions/BadResponse.php
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Spatie\FlareClient\Http\Response;
|
||||
|
||||
class BadResponse extends Exception
|
||||
{
|
||||
public Response $response;
|
||||
|
||||
public static function createForResponse(Response $response): self
|
||||
{
|
||||
$exception = new self("Could not perform request because: {$response->getError()}");
|
||||
|
||||
$exception->response = $response;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
}
|
||||
34
vendor/spatie/flare-client-php/src/Http/Exceptions/BadResponseCode.php
vendored
Normal file
34
vendor/spatie/flare-client-php/src/Http/Exceptions/BadResponseCode.php
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Spatie\FlareClient\Http\Response;
|
||||
|
||||
class BadResponseCode extends Exception
|
||||
{
|
||||
public Response $response;
|
||||
|
||||
/**
|
||||
* @var array<int, mixed>
|
||||
*/
|
||||
public array $errors = [];
|
||||
|
||||
public static function createForResponse(Response $response): self
|
||||
{
|
||||
$exception = new self(static::getMessageForResponse($response));
|
||||
|
||||
$exception->response = $response;
|
||||
|
||||
$bodyErrors = isset($response->getBody()['errors']) ? $response->getBody()['errors'] : [];
|
||||
|
||||
$exception->errors = $bodyErrors;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
public static function getMessageForResponse(Response $response): string
|
||||
{
|
||||
return "Response code {$response->getHttpResponseCode()} returned";
|
||||
}
|
||||
}
|
||||
13
vendor/spatie/flare-client-php/src/Http/Exceptions/InvalidData.php
vendored
Normal file
13
vendor/spatie/flare-client-php/src/Http/Exceptions/InvalidData.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http\Exceptions;
|
||||
|
||||
use Spatie\FlareClient\Http\Response;
|
||||
|
||||
class InvalidData extends BadResponseCode
|
||||
{
|
||||
public static function getMessageForResponse(Response $response): string
|
||||
{
|
||||
return 'Invalid data found';
|
||||
}
|
||||
}
|
||||
13
vendor/spatie/flare-client-php/src/Http/Exceptions/MissingParameter.php
vendored
Normal file
13
vendor/spatie/flare-client-php/src/Http/Exceptions/MissingParameter.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class MissingParameter extends Exception
|
||||
{
|
||||
public static function create(string $parameterName): self
|
||||
{
|
||||
return new self("`$parameterName` is a required parameter");
|
||||
}
|
||||
}
|
||||
13
vendor/spatie/flare-client-php/src/Http/Exceptions/NotFound.php
vendored
Normal file
13
vendor/spatie/flare-client-php/src/Http/Exceptions/NotFound.php
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\FlareClient\Http\Exceptions;
|
||||
|
||||
use Spatie\FlareClient\Http\Response;
|
||||
|
||||
class NotFound extends BadResponseCode
|
||||
{
|
||||
public static function getMessageForResponse(Response $response): string
|
||||
{
|
||||
return 'Not found';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user