Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions plain2code.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,13 @@ def main(): # noqa: C901
console.error(f"Error rendering plain code: {str(e)}\n")
console.debug(f"Render ID: {run_state.render_id}")
except MissingAPIKey as e:
exc_info = sys.exc_info()
console.error(f"Missing API key: {str(e)}\n")
except InvalidAPIKey as e:
exc_info = sys.exc_info()
console.error(f"Invalid API key: {str(e)}\n")
except OutdatedClientVersion as e:
exc_info = sys.exc_info()
console.error(f"Outdated client version: {str(e)}\n")
except (InternalServerError, InternalClientError):
exc_info = sys.exc_info()
Expand Down Expand Up @@ -396,6 +399,9 @@ def main(): # noqa: C901
logging.error("Render crashed with exception:", exc_info=exc_info)
dump_crash_logs(args)

if args.headless and (exc_info is not None or not run_state.render_succeeded):
sys.exit(1)


if __name__ == "__main__": # noqa: C901
main()
Loading