Co-authored-by: Juan Pablo Vial <jpvialb@incoviba.cl>
Reviewed-on: #45
This commit is contained in:
2025-10-04 11:40:52 -03:00
parent 6ddc48ec60
commit 742de657c5
815 changed files with 62089 additions and 3287 deletions

View File

@ -6,10 +6,15 @@ use Throwable;
class EmptyResult extends Exception
{
public function __construct(string $query, ?Throwable $previous = null)
public function __construct(public string $query, ?Throwable $previous = null, protected ?array $data = null)
{
$message = "Empty results for {$query}";
$code = 700;
parent::__construct($message, $code, $previous);
}
public function getData(): ?array
{
return $this->data;
}
}

View File

@ -0,0 +1,13 @@
<?php
namespace Incoviba\Common\Implement\Exception;
use Throwable;
use Exception;
class HttpException extends Exception
{
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
parent::__construct($message, $code, $previous);
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace Incoviba\Common\Implement\Exception;
use Throwable;
use Exception;
class HttpResponse extends Exception
{
public function __construct($reason = "", $message = "", $code = 0, Throwable $previous = null)
{
$this->reason = "HTTP Reason: {$reason}";
parent::__construct($message, $code, $previous);
}
protected string $reason;
public function getReason(): string
{
return $this->reason;
}
}