// RespondError sends the provided error in a JSON format to the client.
RespondError sends the provided error in a JSON format to the client.
// RespondError sends the provided error in a JSON format to the client .
func RespondError(log zerolog.Logger, w http.ResponseWriter, r *http.Request, err error) {
	err = DetectError(err)
	code := ErrorCode(err)
	Respond(log, w, r, err, code)
	if code >= 500 {
		logutil.Critical(log, err).Msg("internal server error")
	}
}
func RespondError ( log zerolog . Logger , w http . ResponseWriter , r * http . Request , err error ) { err = DetectError ( err ) code := ErrorCode ( err ) Respond ( log , w , r , err , code ) if code >= 500 { logutil . Critical ( log , err ) . Msg ( " " ) } }
RespondError sends the provided error in a JSON format to the client.
RespondError sends the provided error in a JSON format to the client .