Skip to content

Improve error output after rendering failed#158

Open
NejcS wants to merge 2 commits intomainfrom
feat/improve_render_error_console_output
Open

Improve error output after rendering failed#158
NejcS wants to merge 2 commits intomainfrom
feat/improve_render_error_console_output

Conversation

@NejcS
Copy link
Copy Markdown
Contributor

@NejcS NejcS commented Apr 14, 2026

Note: Reopend this PR and closed other one because of rebasing mess.

Changes:

  • prints potential errors after the standard post rendering console output
  • removes python traceback from most types of expected exceptions (especially the user centric ones like missing API, credit balance low, missing template ...)
  • removes all with console.status('...'): because those polluted the post rendering console output

Example outputs of failed renders:
Screenshot 2026-04-13 at 14 13 33
Screenshot 2026-04-13 at 14 13 50

@NejcS NejcS requested a review from pedjaradenkovic April 14, 2026 08:24
@NejcS NejcS self-assigned this Apr 14, 2026
@NejcS NejcS force-pushed the feat/improve_render_error_console_output branch from b076c99 to 293c923 Compare April 14, 2026 08:29
Copy link
Copy Markdown
Contributor

@pedjaradenkovic pedjaradenkovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the changes looks good.

I just think that we should move the error message creation to the place where the error is happening. What do you think?

Comment thread plain2code.py Outdated
exc_info = sys.exc_info()
console.error(f"Credit balance too low: {str(e)}\n")
console.debug(f"Render ID: {run_state.render_id}")
error_message = f"Credit balance too low: {str(e)}\n"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would refactor all of those exceptions to be initialised with a proper error message that can be displayed so that each exception can be changed to one line that catches them all and just prints what was written. Does that make sense?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. I did that in the latest commits.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried raising a couple of types of exceptions and it works fine.

Screenshot 2026-04-16 at 09 53 14 Screenshot 2026-04-16 at 09 53 20 Screenshot 2026-04-16 at 09 53 09

@NejcS NejcS force-pushed the feat/improve_render_error_console_output branch from 9d6f8d4 to 5d318d9 Compare April 16, 2026 08:14
@NejcS NejcS requested a review from pedjaradenkovic April 17, 2026 06:04
@NejcS NejcS force-pushed the feat/improve_render_error_console_output branch from 3e223c0 to 72aff66 Compare April 29, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants