We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
UnstableRocketException
1 parent 2931c30 commit d8f80a9Copy full SHA for d8f80a9
rocketpy/exceptions.py
@@ -0,0 +1,21 @@
1
+"""
2
+Custom exceptions for RocketPy library.
3
4
+
5
6
+class RocketPyException(Exception):
7
+ """All RocketPy custom exceptions should inherit from this class."""
8
9
10
+class UnstableRocketError(RocketPyException):
11
+ """Raised when the rocket jas negative static margin."""
12
13
+ def __init__(self, stability_margin):
14
+ self.stability_margin = stability_margin
15
+ self.message = (
16
+ "Rocket is unstable. Initial Static Margin is "
17
+ f"{stability_margin} calibers, this can lead to eternal loop simulation."
18
+ )
19
20
+ def __str__(self):
21
+ return self.message
0 commit comments