8000 Improve error reporting in router panel of web profiler by javiereguiluz · Pull Request #17744 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Improve error reporting in router panel of web profiler #17744

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

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Improve error reporting in router panel of web profiler
  • Loading branch information
javiereguiluz committed Feb 9, 2016
commit 9c69bfcee849bc9b65334dde0e2066adad89b8c5
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,23 @@
<th>Log</th>
</tr>
{% for trace in traces %}
<tr class="{{ 1 == trace.level ? 'almost' : 2 == trace.level ? 'matches' : '' }}">
<td>{{ trace.name }}</td>
<td>{{ trace.path }}</td>
<td>{{ trace.log }}</td>
</tr>
{% if trace.level == -1 %}
<tr class="status-error">
<td colspan="3">
{{ trace.name }}
</td>
</tr>
{% else %}
<tr class="{{ 1 == trace.level ? 'almost' : 2 == trace.level ? 'matches' : '' }}">
<td>{{ trace.name }}</td>
<td>{{ trace.path }}</td>
<td>{{ trace.log }}</td>
</tr>
{% endif %}
{% endfor %}
</table>
<em><small>Note: The above matching is based on the configuration for the current router which might differ from
the configuration used while routing this request.</small></em>
the configuration used while routing this request.
Logs are not available for routes that define conditions using the "request" object.</small></em>
</li>
</ul>
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ public function getTraces($pathinfo)

try {
$this->match($pathinfo);
} catch (ExceptionInterface $e) {
} catch (\Exception $e) {
$this->traces = array(array(
'name' => sprintf('[ERROR] The following exception prevented the route to be matched against application routes: "%s" (in %s line %d)', $e->getMessage(), $e->getFile(), $e->getLine()),
'log' => '-',
'level' => -1,
'path' => '-'
));
}

return $this->traces;
Expand Down
0