Add exceptions for async file handling failures

Introduced two new exceptions, `BadCallToRemoteServer` and `TempUrlRemoteServerException`, to improve error handling in asynchronous file operations. These exceptions are thrown when there are issues with the remote server during an async file operation such as HTTP status codes >= 400 and if the server is unreachable.
This commit is contained in:
2023-12-11 22:47:15 +01:00
parent 28d09a8206
commit 82ca321715
3 changed files with 50 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\DocStoreBundle\AsyncUpload\Exception;
class BadCallToRemoteServer extends \LogicException
{
public function __construct(string $content, int $statusCode, int $code = 0, \Throwable $previous = null)
{
parent::__construct("Bad call to remote server: {$statusCode}, {$content}", $code, $previous);
}
}