Skip to content

Commit 546451e

Browse files
fix(lib): add a more meaningful error message (#30)
* fix(lib): add a more meaningful error message This adds an error message to explain why calling `self.pause()` cannot work if no previous animation was played. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 2457ca8 commit 546451e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

manim_slides/config.py

+5
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,11 @@ def number_is_strictly_posint(cls, v: int):
8484
def start_animation_is_before_end(cls, values):
8585
if values["start_animation"] >= values["end_animation"]:
8686

87+
if values["start_animation"] == values["end_animation"] == 0:
88+
raise ValueError(
89+
"You have to play at least one animation (e.g., `self.wait()`) before pausing. If you want to start paused, use the approriate command-line option when presenting."
90+
)
91+
8792
raise ValueError(
8893
"Start animation index must be strictly lower than end animation index"
8994
)

0 commit comments

Comments
 (0)