<?php

namespace Kylin\GameData\Exceptions;

use Kylin\GameData\Enums\GameDataErrorCode;
use RuntimeException;

class GameDataException extends RuntimeException
{
    public function __construct(
        public readonly GameDataErrorCode $errorCode,
        ?string $message = null,
    ) {
        parent::__construct($message ?? $errorCode->message());
    }
}
