lotus/curiosrc/web/api/apihelper/apihelper.go
Andrew Jackson (Ajax) 672864ad17
Remove "provider" relics (#11992)
* really get rid of provider this time

* one more
2024-05-14 14:50:31 -05:00

20 lines
360 B
Go

package apihelper
import (
"net/http"
"runtime/debug"
logging "github.com/ipfs/go-log/v2"
)
var log = logging.Logger("cu/web/apihelper")
func OrHTTPFail(w http.ResponseWriter, err error) {
if err != nil {
w.WriteHeader(500)
_, _ = w.Write([]byte(err.Error()))
log.Errorw("http fail", "err", err, "stack", string(debug.Stack()))
panic(err)
}
}