<?php

namespace AIPT\Api\Chatbot\Exceptions;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class AsyncUnavailableException extends ChatbotException {

	protected $error_code = 'aipt_chatbot_async_unavailable';
	protected $recoverable = true;
	protected $http_status = 503;

	public function __construct( string $message = '', int $code = 0, ?\Throwable $previous = null ) {
		parent::__construct(
			$message ?: __( 'Chat service is temporarily unavailable. Please try again shortly.', 'ai-product-tools' ),
			$code,
			$previous
		);
	}

	public function getUserMessage(): string {
		return __( 'Chat service is temporarily unavailable. Please try again shortly.', 'ai-product-tools' );
	}
}
