Hotfix/console 404 reporting #2437

Merged
merged 3 commits into from Oct 5, 2012

Conversation

Projects
None yet
5 participants
Owner

weierophinney commented Sep 27, 2012

Adds error reporting capabilities to the Console RouteNotFoundStrategy.

If the view_manager "display_not_found_reason" flag is enabled, this will display the reason for the "404" condition, as well as any exceptions, if any, present in the event (looping through all previous exceptions).

EvanDotPro was assigned Sep 27, 2012

@Freeaqingme Freeaqingme and 2 others commented on an outdated diff Sep 28, 2012

library/Zend/Mvc/View/Console/RouteNotFoundStrategy.php
$result = $banner ? rtrim($banner, "\r\n") : '';
$result .= $usage ? "\n\n" . trim($usage, "\r\n") : '';
$result .= "\n"; // to ensure we output a final newline
+
+ // Report 404 reason and/or exceptions
@Freeaqingme

Freeaqingme Sep 28, 2012

Member

This method hereby becomes 100+ lines long. Can't we move this to its own method?

@b-durand

b-durand Sep 28, 2012

Contributor

+1

The getConsoleUsage() method has 100+ lines too 😔

@weierophinney

weierophinney Oct 1, 2012

Owner

@Freeaqingme Done.

@b-durand I didn't add any code to getConsoleUsage(), which makes that out-of-scope for this PR.

weierophinney added some commits Sep 27, 2012

@weierophinney weierophinney Display reason for not-found conditions in Console
- If display_not_found_reason is enabled, use this value to display:
  - reason for "404"
  - any related exceptions
aae13cb
@weierophinney weierophinney Display previous exceptions as well
- so that we can determine full root cause from CLI
982e0c6
@weierophinney weierophinney Extract method
- extracted display_not_found_reason and exception reporting to
  reportNotFoundReason() method, per feedback on pull request.
52162ad
Owner

weierophinney commented Oct 4, 2012

I figured a force push would tell travis to re-run. Odd.

Rebased off of latest master, which corrects the CS issues reported in the former travis results. I've also extracted the logic for displaying the exception stack trace to a new method, addressing the concerns @Freeaqingme raised.

@ralphschindler ralphschindler merged commit 52162ad into zendframework:master Oct 5, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment