package tigin

import (
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/tidbcloud/tiinf/errs"
)

func Ping(c *gin.Context) {
	shouldFail := c.Query("shouldFail")
	if shouldFail != "" {
		AbortWithError(c, errs.NewInternalHTTP("failed to serve", nil))
		return
	}

	c.String(http.StatusOK, "pong")
}
