// return an error code with an overriden message (to avoid exposing the details)
// log full error
return an error code with an overriden message (to avoid exposing the details)
log full error
// return an error code with an overriden message ( to avoid exposing the details ) // log full error
func restErrWithLogMsg(w rest.ResponseWriter, r *rest.Request, l *log.Logger, e error, code int, msg string) {
	w.WriteHeader(code)
	err := w.WriteJson(map[string]string{
		rest.ErrorFieldName: msg,
		"request_id":        requestid.RequestIdFromContext(r.Context()),
	})
	if err != nil {
		panic(err)
	}
	l.F(log.Ctx{}).Error(errors.Wrap(e, msg).Error())
}
func restErrWithLogMsg ( w rest . ResponseWriter , r * rest . Request , l * log . Logger , e error , code int , msg string ) { w . WriteHeader ( code ) err := w . WriteJson ( map [ string ] string { rest . ErrorFieldName : msg , " " : requestid . RequestIdFromContext ( r . Context ( ) ) , } ) if err != nil { panic ( err ) } l . F ( log . Ctx { } ) . Error ( errors . Wrap ( e , msg ) . Error ( ) ) }
return an error code with an overriden message (to avoid exposing the details)
log full error
return an error code with an overriden message ( to avoid exposing the details ) log full error