Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4718e77

Browse filesBrowse files
committed
Adds call stack display to runtime panic in browser to match console message for revel#647
1 parent 6d0c82d commit 4718e77
Copy full SHA for 4718e77

File tree

Expand file treeCollapse file tree

2 files changed

+19
-4
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+19
-4
lines changed

‎errors.go

Copy file name to clipboardExpand all lines: errors.go
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func NewErrorFromPanic(err interface{}) *Error {
5151
description = fmt.Sprint(err)
5252
}
5353
return &Error{
54-
Title: "Panic",
54+
Title: "Runtime Panic",
5555
Path: filename[len(basePath):],
5656
Line: line,
5757
Description: description,

‎templates/errors/500-dev.html

Copy file name to clipboardExpand all lines: templates/errors/500-dev.html
+18-3Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,21 @@
7878
font-style: normal;
7979
font-weight: bold;
8080
}
81+
#stack {
82+
background: #eee;
83+
padding:0 1em 1em;
84+
}
85+
#stack h3 {
86+
font-weight: normal;
87+
}
88+
#stack code {
89+
font-family:monospace;
90+
white-space: pre;
91+
}
8192
</style>
8293
{{with .Error}}
8394
<div id="header" class="block">
84-
<h1>
85-
{{.Title}}
86-
</h1>
95+
<h1>{{.Title}}</h1>
8796
<p>
8897
{{if .SourceType}}
8998
The {{.SourceType}}
@@ -117,6 +126,12 @@ <h2>In {{.Path}}
117126
{{end}}
118127
</div>
119128
{{end}}
129+
{{if .Stack}}
130+
<div id="stack">
131+
<h3>Call Stack</h3>
132+
<code>{{.Stack}}</code>
133+
</div>
134+
{{end}}
120135
{{if .MetaError}}
121136
<div id="source" class="block">
122137
<h2>Additionally, an error occurred while handling this error.</h2>

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.