- Fixed error throwing while building relation

This commit is contained in:
Dev 2026-01-16 21:28:40 +00:00
parent 36162c6486
commit b0b3aca6d9

View File

@ -84,7 +84,8 @@ class RelationBuilder
} }
} }
catch(\Throwable $e) { catch(\Throwable $e) {
throw new $e(sprintf("An error occurred while calling method from your #[Virtual] attribute in entity '%s::%s'. Caught '%s'", $this->entity::class, $name, $e->getMessage() ));
throw new $e(sprintf("An error occurred while calling method from your #[Virtual] attribute in entity '%s::%s'. Caught '%s'", $this->entity::class, $name, $e->getMessage(), $e->getCode(), $e ));
} }
} }