참고소스 수정본

This commit is contained in:
LASTA_DEV01\lasta
2026-05-12 19:40:31 +09:00
parent 0f34a451fc
commit 2e9204243d
8708 changed files with 3259488 additions and 869 deletions

View File

@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace Firecrawl\Exceptions;
class AuthenticationException extends FirecrawlException
{
public function __construct(
string $message = 'Authentication failed. Check your API key.',
?string $errorCode = null,
mixed $details = null,
) {
parent::__construct($message, 401, $errorCode, $details);
}
}

View File

@@ -0,0 +1,36 @@
<?php
declare(strict_types=1);
namespace Firecrawl\Exceptions;
use RuntimeException;
use Throwable;
class FirecrawlException extends RuntimeException
{
public function __construct(
string $message = '',
private readonly int $statusCode = 0,
private readonly ?string $errorCode = null,
private readonly mixed $details = null,
?Throwable $previous = null,
) {
parent::__construct($message, $statusCode, $previous);
}
public function getStatusCode(): int
{
return $this->statusCode;
}
public function getErrorCode(): ?string
{
return $this->errorCode;
}
public function getDetails(): mixed
{
return $this->details;
}
}

View File

@@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace Firecrawl\Exceptions;
class JobTimeoutException extends FirecrawlException
{
public function __construct(
private readonly string $jobId,
private readonly int $timeoutSeconds,
string $jobType = 'Job',
) {
parent::__construct(
"{$jobType} {$jobId} timed out after {$timeoutSeconds} seconds",
statusCode: 408,
);
}
public function getJobId(): string
{
return $this->jobId;
}
public function getTimeoutSeconds(): int
{
return $this->timeoutSeconds;
}
}

View File

@@ -0,0 +1,16 @@
<?php
declare(strict_types=1);
namespace Firecrawl\Exceptions;
class RateLimitException extends FirecrawlException
{
public function __construct(
string $message = 'Rate limit exceeded.',
?string $errorCode = null,
mixed $details = null,
) {
parent::__construct($message, 429, $errorCode, $details);
}
}