Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FrameworkBundle] added support for previous exceptions in the except…
…ion pages
- Loading branch information
Showing
18 changed files
with
247 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 20 additions & 4 deletions
24
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.json.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
<?php echo json_encode(array( | ||
<?php | ||
|
||
$vars = array( | ||
'error' => array( | ||
'code' => $manager->getStatusCode(), | ||
'message' => $manager->getMessage(), | ||
'debug' => array( | ||
'message' => $manager->getName(), | ||
'exception' => array( | ||
'name' => $manager->getName(), | ||
'message' => $manager->getMessage(), | ||
'traces' => $manager->getTraces(), | ||
), | ||
))) ?> | ||
)); | ||
|
||
if (count($managers)) { | ||
$vars['exceptions'] = array(); | ||
foreach ($managers as $i => $previous) { | ||
$vars['exceptions'][] = array( | ||
'name' => $previous->getName(), | ||
'message' => $previous->getMessage(), | ||
'traces' => $previous->getTraces(), | ||
); | ||
} | ||
} | ||
|
||
echo json_encode($vars); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 13 additions & 8 deletions
21
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.txt.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
[exception] <?php echo $manager->getStatusCode().' | '.$manager->getStatusText().' | '.$manager->getName() ?> | ||
[exception] <?php echo $manager->getStatusCode().' | '.$manager->getStatusText().' | '.$manager->getName() ?> | ||
|
||
[message] <?php echo $manager->getMessage() ?> | ||
[message] <?php echo $manager->getMessage() ?> | ||
|
||
<?php if (count($manager->getTraces())): ?> | ||
[stack trace] | ||
<?php foreach ($manager->getTraces() as $i => $trace): ?> | ||
<?php echo $view->render('FrameworkBundle:Exception:trace.txt', array('i' => $i, 'trace' => $trace)) ?> | ||
<?php echo $view->render('FrameworkBundle:Exception:traces', array('manager' => $manager, 'position' => 0, 'count' => count($managers))) ?> | ||
|
||
<?php endforeach; ?> | ||
<?php endif; ?> | ||
<?php if (count($managers)): ?> | ||
<?php foreach ($managers as $i => $previous): ?> | ||
[linked exception] <?php echo $previous->getName() ?>: <?php echo $previous->getMessage() ?> | ||
|
||
<?php echo $view->render('FrameworkBundle:Exception:traces', array('manager' => $previous, 'position' => $i + 1, 'count' => count($managers))) ?> | ||
|
||
<?php endforeach; ?> | ||
<?php endif; ?> | ||
[symfony] v. <?php echo \Symfony\Framework\Kernel::VERSION ?> (symfony-project.org) | ||
[PHP] v. <?php echo PHP_VERSION ?> | ||
|
||
[symfony] v. <?php echo \Symfony\Framework\Kernel::VERSION ?> (symfony-project.org) | ||
[PHP] v. <?php echo PHP_VERSION ?> |
20 changes: 9 additions & 11 deletions
20
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/exception.xml.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<?php echo sprintf('<?xml version="1.0" encoding="%s" ?>', $view->getCharset())."\n" ?> | ||
<error code="<?php echo $manager->getStatusCode() ?>" message="<?php echo $manager->getStatusText() ?>"> | ||
<debug> | ||
<name><?php echo $manager->getName() ?></name> | ||
<message><?php echo htmlspecialchars($manager->getMessage(), ENT_QUOTES, $view->getCharset()) ?></message> | ||
<traces> | ||
<?php foreach ($manager->getTraces() as $i => $trace): ?> | ||
<trace> | ||
<?php echo $view->render('FrameworkBundle:Exception:trace.txt', array('i' => $i, 'trace' => $trace)) ?> | ||
|
||
</trace> | ||
<exception class="<?php echo $manager->getName() ?>" message="<?php echo $manager->getMessage() ?>"> | ||
<?php echo $view->render('FrameworkBundle:Exception:traces', array('manager' => $manager, 'position' => 0, 'count' => count($managers))) ?> | ||
</exception> | ||
<?php if (count($managers)): ?> | ||
<?php foreach ($managers as $i => $previous): ?> | ||
<exception class="<?php echo $previous->getName() ?>" message="<?php echo $previous->getMessage() ?>"> | ||
<?php echo $view->render('FrameworkBundle:Exception:traces', array('manager' => $previous, 'position' => $i + 1, 'count' => count($managers))) ?> | ||
</exception> | ||
<?php endforeach; ?> | ||
</traces> | ||
</debug> | ||
<?php endif; ?> | ||
</error> |
48 changes: 32 additions & 16 deletions
48
src/Symfony/Bundle/FrameworkBundle/Resources/views/Exception/styles.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
body { margin: 0; padding: 0; margin-top: 30px; background-color: #eee } | ||
body, td, th { font: 11px Verdana, Arial, sans-serif; color: #333 } | ||
/* | ||
Copyright (c) 2010, Yahoo! Inc. All rights reserved. | ||
Code licensed under the BSD License: | ||
http://developer.yahoo.com/yui/license.html | ||
version: 3.1.2 | ||
build: 56 | ||
*/ | ||
html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;} | ||
|
||
/* | ||
Symfony stylesheet | ||
*/ | ||
html { background: #eee } | ||
body { font: 11px Verdana, Arial, sans-serif; color: #333 } | ||
strong { font-weight: bold } | ||
em { font-style: italic } | ||
a { color: #333 } | ||
h1 { margin: 0; margin-top: 4px; font-weight: normal; font-size: 170%; letter-spacing: -0.03em; } | ||
h2 { margin: 0; padding: 0; font-size: 90%; font-weight: normal; letter-spacing: -0.02em; } | ||
h3 { margin: 0; padding: 0; margin-bottom: 10px; font-size: 110% } | ||
ul { padding-left: 20px; list-style: decimal } | ||
ul li { padding-bottom: 5px; margin: 0 } | ||
ol { font-family: monospace; white-space: pre; list-style-position: inside; margin: 0; padding: 10px 0 } | ||
ol li { margin: -5px; padding: 0 } | ||
abbr { border-bottom: 1px dotted #000000; cursor: help } | ||
h1 { font-size: 170%; letter-spacing: -0.03em; } | ||
h2 { margin-top: 4px; font-size: 90%; letter-spacing: -0.02em; } | ||
h3 { font-size: 130%; font-weight: bold; letter-spacing: -0.02em; } | ||
h3 span { float: right; font-size: 80%; background: #eee; color: #333; padding: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } | ||
ul { padding-left: 20px } | ||
ul li { padding-bottom: 5px; list-style: decimal } | ||
ol { font-family: monospace; white-space: pre; padding: 10px 0 } | ||
ol li { margin: -5px; list-style: decimal; list-style-position: inside } | ||
ol .selected { font-weight: bold; background-color: #ffd; padding: 2px 0 } | ||
table.vars { padding: 0; margin: 0; border: 1px solid #999; background-color: #fff; } | ||
table.vars th { padding: 2px; background-color: #ddd; font-weight: bold } | ||
table.vars td { padding: 2px; font-family: monospace; white-space: pre } | ||
p.error { padding: 10px; background-color: #f00; font-weight: bold; text-align: center; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; } | ||
p.error a { color: #fff } | ||
#main { padding: 20px 25px; margin: 0; margin-bottom: 20px; border: 1px solid #ddd; background-color: #fff; text-align:left; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; min-width: 770px; max-width: 770px } | ||
#message { padding: 20px 25px; margin: 0; margin-bottom: 5px; border: 1px solid #ddd; text-align:left; background-color: #c8e8f3; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; min-width: 770px; max-width: 770px } | ||
.block { padding: 20px 25px; margin-bottom: 10px; border: 1px solid #ddd; background-color: #fff; text-align:left; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; min-width: 770px; max-width: 770px } | ||
.traces { display: none; margin-top: 10px } | ||
#message { margin-top: 30px; margin-bottom: 10px; padding: 20px 25px; border: 1px solid #ddd; text-align:left; background-color: #c8e8f3; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; min-width: 770px; max-width: 770px } | ||
#content { border: 1px solid #ddd; margin-top: 10px; padding: 7px; overflow: auto; } | ||
a.file_link { text-decoration: none; } | ||
a.file_link:hover { text-decoration: underline; } | ||
.code { overflow: auto; } | ||
img { vertical-align: middle; } | ||
a img { border: 0; } | ||
.error { background-color: #f66; padding: 1px 3px; color: #111; } | ||
.error { background-color: #f66 } | ||
.linked ul, .linked li { padding-left: 0; display: inline } | ||
.linked li { padding-right: 7px } | ||
#logs { margin-top: 10px } |
Oops, something went wrong.