Skip to content
Snippets Groups Projects
Commit 9d2f1f31 authored by Mateusz Żebrak's avatar Mateusz Żebrak
Browse files

Provide additional explaination for ProfileNotLoadedError raised from...

Provide additional explaination for ProfileNotLoadedError raised from World.profile and World.node properties
parent 5419e86a
No related branches found
No related tags found
2 merge requests!600v1.27.5.21 Release,!558Remove welcome profile from TUIWorld, set TUIWorld profile during CreateProfile wizard instead
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment