Skip to content

Commit b5eb901

Browse files
committed
CEDARScriptEditorException: Better message formatting
1 parent f0daff1 commit b5eb901

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/cedarscript_editor/cedarscript_editor.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,19 @@ def __init__(self, command_ordinal: int, description: str):
5050
f"due to changes that left the file in an invalid state (check that by re-reading the file!)</note>"
5151
)
5252
super().__init__(
53-
f"<error-details>\n<error-location>COMMAND #{command_ordinal}</error-location>"
53+
"<error-details>"
54+
f"\n<error-location>COMMAND #{command_ordinal}</error-location>"
5455
f"\n<description>{description}</description>"
55-
f"{note}"
56-
"<suggestion>NEVER apologize; just relax, take a deep breath, think step-by-step and write "
56+
f"\n{note}"
57+
"\n<suggestion>NEVER apologize; just relax, take a deep breath, think step-by-step and write "
5758
"an in-depth analysis of what went wrong (specifying which command ordinal failed), "
5859
"then acknowledge which commands were already applied and concisely describe "
5960
"the state at which the file was left (saying what needs to be done now), "
6061
f"then write new commands that will fix the problem{previous_cmd_notes} "
6162
"(you'll get a one-million dollar tip if you get it right!) "
6263
"Use descriptive comment before each command; If showing CEDARScript commands to the user, "
6364
"*DON'T* enclose them in ```CEDARSCript and ``` otherwise they will be executed!"
64-
"</suggestion></error-details>"
65+
"</suggestion>\n</error-details>"
6566
)
6667

6768

0 commit comments

Comments
 (0)