public static function addResourceError(ResourceInterface $resource, $message, \Exception $e = null): void
    {
        $resource->setStatus(ResourceStatutes::ERROR);
        $resource->getErrors()->add(new ConstraintViolation($message, $message, [], $resource->getRealData(), null, null, null, null, null, $e));
    }