From 9d2f1f314ed4cec40faa2980652d662854505198 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BBebrak?= <mzebrak@syncad.com> Date: Tue, 18 Mar 2025 11:42:39 +0100 Subject: [PATCH] Provide additional explaination for ProfileNotLoadedError raised from World.profile and World.node properties --- clive/__private/core/world.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clive/__private/core/world.py b/clive/__private/core/world.py index eaedd5a99c..6a6d2c1096 100644 --- a/clive/__private/core/world.py +++ b/clive/__private/core/world.py @@ -72,7 +72,7 @@ class World: @property def profile(self) -> Profile: if self._profile is None: - raise ProfileNotLoadedError + raise ProfileNotLoadedError("World profile cannot be accessed before it is loaded.") return self._profile @property @@ -83,7 +83,9 @@ class World: def node(self) -> Node: """Node shouldn't be used for direct API calls in CLI/TUI. Instead, use commands which also handle errors.""" if self._node is None: - raise ProfileNotLoadedError + raise ProfileNotLoadedError( + "World node cannot be accessed before profile is loaded as it is profile dependent." + ) return self._node @property -- GitLab