What's the best way to show errors, in case they should occur?
I've tried to use PromptUtils.println(), but I can't seem to make it work.
Example code:
def add_supplier() -> None:
try:
new_supplier = read_supplier_df()
df = pd.concat([df, new_supplier])
df.to_csv(SUPPLIERS_FILE_PATH) # could fail if the directory is not writable
except Exception as ex:
PromptUtils(Screen()).println(ex) # Display the full exception
main_menu.append_item(FunctionItem("Add supplier", add_supplier))
What's the best way to show errors, in case they should occur?
I've tried to use PromptUtils.println(), but I can't seem to make it work.
Example code: