imageId = $imageId; $this->provider = $provider; $this->exception = $exception; $this->timestamp = time(); } /** * Get the image ID. * * @return int */ public function getImageId(): int { return $this->imageId; } /** * Get the provider name. * * @return string */ public function getProvider(): string { return $this->provider; } /** * Get the exception that caused the failure. * * @return Throwable */ public function getException(): Throwable { return $this->exception; } /** * Get the error message. * * @return string */ public function getErrorMessage(): string { return $this->exception->getMessage(); } /** * Get the timestamp when the event occurred. * * @return int Unix timestamp */ public function getTimestamp(): int { return $this->timestamp; } /** * Mark the error as handled. * * This can be used by listeners to indicate they have * processed/logged the error to prevent duplicate handling. * * @return void */ public function markAsHandled(): void { $this->handled = true; } /** * Check if the error has been handled. * * @return bool */ public function isHandled(): bool { return $this->handled; } /** * Get a formatted error message for logging. * * @return string */ public function getFormattedErrorMessage(): string { return sprintf( '%s - %s', $this->provider, $this->exception->getMessage() ); } }