Skip to content

Propagate errors from custom pretty printers - #99

Open
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/propagate-pretty-print-errors
Open

Propagate errors from custom pretty printers#99
OskarEichler wants to merge 1 commit into
ruby:masterfrom
OskarEichler:codex/propagate-pretty-print-errors

Conversation

@OskarEichler

Copy link
Copy Markdown

Problem: PPMethods#pp treats every NoMethodError raised by a custom pretty_print implementation as if the method were absent, silently replacing the failure with generic inspect output. This also hides missing methods called inside the printer and missing super implementations.

Fix: Fall back only when the missing call is exactly pretty_print on the object being rendered and a core respond_to? check confirms the method is absent. Internal printer errors continue to propagate.

Regression coverage: Adds an upstream regression that asserts both the raised exception and missing method name. The combined completion branch passes 42 tests / 64 assertions on Ruby 4.0.6 and 39 / 56 on Ruby 3.2, plus 510 focused model checks on each Ruby.

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