Add more logging for test data api endpoint
This commit is contained in:
parent
265e778867
commit
9559cbf1ec
1 changed files with 3 additions and 0 deletions
|
@ -18,6 +18,7 @@ package v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"code.vikunja.io/api/pkg/log"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -52,6 +53,7 @@ func HandleTesting(c echo.Context) error {
|
||||||
content := []map[string]interface{}{}
|
content := []map[string]interface{}{}
|
||||||
err := json.Unmarshal(buf.Bytes(), &content)
|
err := json.Unmarshal(buf.Bytes(), &content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Errorf("Error replacing table data: %v", err)
|
||||||
return c.JSON(http.StatusInternalServerError, map[string]interface{}{
|
return c.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||||
"error": true,
|
"error": true,
|
||||||
"message": err.Error(),
|
"message": err.Error(),
|
||||||
|
@ -66,6 +68,7 @@ func HandleTesting(c echo.Context) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
log.Errorf("Error replacing table data: %v", err)
|
||||||
return c.JSON(http.StatusInternalServerError, map[string]interface{}{
|
return c.JSON(http.StatusInternalServerError, map[string]interface{}{
|
||||||
"error": true,
|
"error": true,
|
||||||
"message": err.Error(),
|
"message": err.Error(),
|
||||||
|
|
Loading…
Reference in a new issue