Raising errors — making your code fail loudly on purpose — step 7 of 9
Cursor wrote a function that catches an exception, logs it, and was
supposed to re-raise so the caller still sees the failure. Instead it
catches, logs, and silently returns None. The script then crashes
later in a confusing place because a downstream call gets None.
Add a single line so that after the print on line 5, the same
exception keeps propagating. The bare raise keyword (no class, no
message) re-raises the exception that was just caught.
Expected output:
logging: bad input
caught at top: bad input
Cursor wrote a function that catches an exception, logs it, and was
supposed to re-raise so the caller still sees the failure. Instead it
catches, logs, and silently returns None. The script then crashes
later in a confusing place because a downstream call gets None.
Add a single line so that after the print on line 5, the same
exception keeps propagating. The bare raise keyword (no class, no
message) re-raises the exception that was just caught.
Expected output:
logging: bad input
caught at top: bad input
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.