Skip to content

Fix #3503: prints exception variable contents#3504

Merged
jmolivas merged 1 commit into
hechoendrupal:masterfrom
kylethebaker:3503-fix-update-entities-command-error
Aug 31, 2017
Merged

Fix #3503: prints exception variable contents#3504
jmolivas merged 1 commit into
hechoendrupal:masterfrom
kylethebaker:3503-fix-update-entities-command-error

Conversation

@kylethebaker
Copy link
Copy Markdown
Contributor

There are other approaches here, but this is the most straightforward. Initially I was using Error::renderExceptionSafe which will render the exception into a string, but it contains html markup which doesn't play nice with console. The markup can then be passed to Drupal\Component\Render\PlainTextOutput::renderFromHtml which will strip the tags. But ultimately it's just a round about way to accomplish what I have here.

_drupal_log_exception uses strtr so I took inspiration from there. If there is a more "drupal" way to render the exception contents into a plaintext string then that might be better.

@kylethebaker kylethebaker changed the title Fix #3505: prints exception variable contents Fix #3503: prints exception variable contents Aug 30, 2017
@kylethebaker
Copy link
Copy Markdown
Contributor Author

#3503 Adding this here since I used the wrong issue in the title initially

@jmolivas jmolivas modified the milestone: 1.0.2 Aug 31, 2017
@jmolivas jmolivas merged commit bca9949 into hechoendrupal:master Aug 31, 2017
@jmolivas
Copy link
Copy Markdown
Member

@kylethebaker Thanks for your contribution, your PR was merged. This will be included in the next release.

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