18 lines
272 B
Go
18 lines
272 B
Go
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,
|
|
})
|
|
}
|