Skip to content

added ExceptionHandler::getHtml() to expose the full HTML of an exception #15710

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

Merged
merged 1 commit into from
Sep 7, 2015

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Sep 7, 2015

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets n/a
License MIT
Doc PR n/a

ExceptionHandler::createResponse() has been deprecated in 2.8 to remove the HttpFoundation dependency on symfony/debug. But that breaks Silex which relies on this method. As the decorate method is private, there is no way in Silex to upgrade. Instead of making the decorate() method public, I propose to add a new getHtml() method that returns the exception as a full HTML page.

@stof
Copy link
Member

stof commented Sep 7, 2015

and now, we remember why ExceptionHandler::createResponse() was part of the public API. It was probably added for Silex already 😄

/**
* Gets the full HTML content associated with the given exception.
*
* @param \Exception|FlattenException $exception An \Exception instance
Copy link
Member

Choose a reason for hiding this comment

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

the argument description is wrong in case a FlattenException is passed

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@fabpot fabpot force-pushed the exception-handler-bc-break branch from 1d27717 to 4d1d277 Compare September 7, 2015 14:37
@fabpot fabpot merged commit 4d1d277 into symfony:2.8 Sep 7, 2015
fabpot added a commit that referenced this pull request Sep 7, 2015
…TML of an exception (fabpot)

This PR was merged into the 2.8 branch.

Discussion
----------

added ExceptionHandler::getHtml() to expose the full HTML of an exception

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

`ExceptionHandler::createResponse()` has been deprecated in 2.8 to remove the HttpFoundation dependency on `symfony/debug`. But that breaks Silex which relies on this method. As the `decorate` method is private, there is no way in Silex to upgrade. Instead of making the `decorate()` method public, I propose to add a new `getHtml()` method that returns the exception as a full HTML page.

Commits
-------

4d1d277 added ExceptionHandler::getHtml() to expose the full HTML of an exception
@fabpot fabpot mentioned this pull request Nov 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants