properly return error values if a server error occurs
This commit is contained in:
@@ -26,6 +26,7 @@ func HandleGETBackups(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
backups, err := GetInstanceBackups(vm_path, auth)
|
||||
@@ -57,6 +58,7 @@ func HandleGETBackupsFragment(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
backups, err := GetInstanceBackups(vm_path, auth)
|
||||
|
||||
@@ -52,6 +52,7 @@ func HandleGETConfig(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
config, err := GetInstanceConfig(vm_path, auth)
|
||||
@@ -87,6 +88,7 @@ func HandleGETConfigVolumesFragment(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
config, err := GetInstanceConfig(vm_path, auth)
|
||||
@@ -110,6 +112,7 @@ func HandleGETConfigNetsFragment(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
config, err := GetInstanceConfig(vm_path, auth)
|
||||
@@ -133,6 +136,7 @@ func HandleGETConfigDevicesFragment(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
config, err := GetInstanceConfig(vm_path, auth)
|
||||
@@ -156,6 +160,7 @@ func HandleGETConfigBootFragment(c *gin.Context) {
|
||||
vm_path, err := common.ExtractVMPath(c)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
config, err := GetInstanceConfig(vm_path, auth)
|
||||
|
||||
@@ -50,6 +50,7 @@ func HandleGETIndex(c *gin.Context) {
|
||||
instances, _, err := GetClusterResources(auth)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
page := gin.H{
|
||||
"global": common.Global,
|
||||
@@ -68,6 +69,7 @@ func HandleGETInstancesFragment(c *gin.Context) {
|
||||
instances, _, err := GetClusterResources(auth)
|
||||
if err != nil {
|
||||
common.HandleNonFatalError(c, err)
|
||||
return
|
||||
}
|
||||
c.Header("Content-Type", "text/plain")
|
||||
common.TMPL.ExecuteTemplate(c.Writer, "html/index-instances.go.tmpl", gin.H{
|
||||
|
||||
Reference in New Issue
Block a user