Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional error fallbacks during rendering. #28

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

copybara-service[bot]
Copy link

Add additional error fallbacks during rendering.

  • Avoid calling repr in the renderer last-resort fallback, since
    this is user-defined and can still throw an exception for invalid
    objects.
  • Catch errors while rendering deferred parts, to avoid breaking the
    IPython display integration if a deferred part raises an exception.
    (This can happen due to bugs in array rendering adapters, for instance.)
    Before, errors in deferred parts could bubble out to IPython, which would
    fall back to text rendering, even though a partial HTML output was already
    shown.
  • Add tests for custom handlers and error checking logic.

- Avoid calling __repr__ in the renderer last-resort fallback, since
  this is user-defined and can still throw an exception for invalid
  objects.
- Catch errors while rendering deferred parts, to avoid breaking the
  IPython display integration if a deferred part raises an exception.
  (This can happen due to bugs in array rendering adapters, for instance.)
  Before, errors in deferred parts could bubble out to IPython, which would
  fall back to text rendering, even though a partial HTML output was already
  shown.
- Add tests for custom handlers and error checking logic.

PiperOrigin-RevId: 668126136
@copybara-service copybara-service bot merged commit 1b8eca6 into main Aug 27, 2024
@copybara-service copybara-service bot deleted the test_667676889 branch August 27, 2024 20:54
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.

1 participant