// JsonError returns the JSON errors based on GeneralError model.
JsonError returns the JSON errors based on GeneralError model.
// JsonError returns the JSON errors based on GeneralError model .
func JsonError(ctx echo.Context, err *models.GeneralError) error {
	if err.HttpCode == 0 {
		err.HttpCode = http.StatusBadRequest
	}
	if err.Message == "" {
		err.Message = models.ErrorUnknownError
	}
	if err.Code == "" {
		err.Code = "common"
	}
	return ctx.JSON(err.HttpCode, err)
}
func JsonError ( ctx echo . Context , err * models . GeneralError ) error { if err . HttpCode == 0 { err . HttpCode = http . StatusBadRequest } if err . Message == " " { err . Message = models . ErrorUnknownError } if err . Code == " " { err . Code = " " } return ctx . JSON ( err . HttpCode , err ) }
JsonError returns the JSON errors based on GeneralError model.
JsonError returns the JSON errors based on GeneralError model .