mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 16:57:14 -06:00
fixed error handling, and error logging for panel rendering
This commit is contained in:
parent
8e1b753664
commit
e5fbbe96fd
BIN
data/png/77dedee4f4d479cea6f9d608353ed098.png
Normal file
BIN
data/png/77dedee4f4d479cea6f9d608353ed098.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
BIN
data/png/9e956287bee2bc4eabd91f9bb06ab458.png
Normal file
BIN
data/png/9e956287bee2bc4eabd91f9bb06ab458.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 72 KiB |
1
grafana
1
grafana
@ -1 +0,0 @@
|
||||
Subproject commit d5471c153ab8ab0d4be57154300d28a75af1d363
|
@ -20,10 +20,11 @@ func RenderToPng(c *middleware.Context) {
|
||||
}
|
||||
|
||||
renderOpts.Url = "http://localhost:3000/" + renderOpts.Url
|
||||
|
||||
pngPath, err := renderer.RenderToPng(renderOpts)
|
||||
|
||||
if err != nil {
|
||||
c.HTML(500, "error.html", nil)
|
||||
c.Handle(500, "Failed to render to png", err)
|
||||
return
|
||||
}
|
||||
|
||||
c.Resp.Header().Set("Content-Type", "image/png")
|
||||
|
@ -88,12 +88,7 @@ func (ctx *Context) Handle(status int, title string, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
switch status {
|
||||
case 404:
|
||||
ctx.Data["Title"] = "Page Not Found"
|
||||
case 500:
|
||||
ctx.Data["Title"] = "Internal Server Error"
|
||||
}
|
||||
ctx.Data["Title"] = title
|
||||
|
||||
ctx.HTML(status, strconv.Itoa(status))
|
||||
}
|
||||
|
@ -22,8 +22,6 @@
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<panel-loader type="'test'"></panel-loader>
|
||||
|
||||
<br>
|
||||
<button type="submit" class="pull-right btn btn-success" ng-click="update()">Update</button>
|
||||
</form>
|
||||
|
32
src/views/500.html
Normal file
32
src/views/500.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<title>Grafana</title>
|
||||
|
||||
<link rel="stylesheet" href="[[.AppSubUrl]]/css/grafana.dark.min.css" title="Dark">
|
||||
<link rel="icon" type="image/png" href="[[.AppSubUrl]]/img/fav32.png">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="gf-box" style="margin: 200px auto 0 auto; width: 500px;">
|
||||
<div class="gf-box-header">
|
||||
<span class="gf-box-title">
|
||||
Server side error :(
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="gf-box-body">
|
||||
<h4>[[.Title]]</h4>
|
||||
[[.ErrorMsg]]
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user