Skip to content
This repository was archived by the owner on Feb 15, 2025. It is now read-only.

Application::handleRequest now properly displays exceptions.#976

Closed
Adirelle wants to merge 2 commits into
dancryer:masterfrom
Adirelle:web-error-fix
Closed

Application::handleRequest now properly displays exceptions.#976
Adirelle wants to merge 2 commits into
dancryer:masterfrom
Adirelle:web-error-fix

Conversation

@Adirelle
Copy link
Copy Markdown
Contributor

Contribution Type: bug fix
Primary Area: front-end
Link to Bug: #960, #929, #719.

Description of change: properly display exceptions happening while handling a request.

Description of solution: modified Application::handleRequest.

@Adirelle
Copy link
Copy Markdown
Contributor Author

Combined with Block8/b8framework#41 (on the 1.x version of the framework), this allows to gracefully handle "not found" exceptions.

Comment thread PHPCI/Application.php Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure have a condition check here is good.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the only differences between the two catch blocks. If HttpException used/overrode Exception::getCode instead of defining its own getErrorCode, this checks wouldn't even be necessary.

Comment thread PHPCI/Application.php Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Typo, should be $this->response(missing S)

@mavimo
Copy link
Copy Markdown
Collaborator

mavimo commented May 18, 2015

This should not merge since the b8 framework fix was added.

@Adirelle
Copy link
Copy Markdown
Contributor Author

The PR fixes all exception handling on its own; it doesn't depend on the b8framework PR, which just sends a proper 404 HttpException instead of a PHP error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants