TP-55555 | fix es query for pagination
This commit is contained in:
17
pkg/utils/ErrorResponse.go
Normal file
17
pkg/utils/ErrorResponse.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func ErrorResponse(c *gin.Context, errMsg string) {
|
||||
if errMsg == "" {
|
||||
errMsg = "Something went wrong"
|
||||
}
|
||||
|
||||
c.JSON(http.StatusInternalServerError, gin.H{
|
||||
"status": "error",
|
||||
"message": errMsg,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user