func Handle(w http.ResponseWriter, r *http.Request, err error) {
	if handler, ok := whcompat.Context(r).Value(errHandler).(Handler); ok {
		handler.HandleError(w, r, err)
		return
	}
	log.Printf("error: %v", err)
	http.Error(w, errhttp.GetErrorBody(err),
		errhttp.GetStatusCode(err, http.StatusInternalServerError))
}
Handle uses the provided error handler given via HandleWith
to handle the error, falling back to a built in default if not provided.
package wherr  
import (
	"log"
	"net/http"
	"github.com/spacemonkeygo/errors"
	"github.com/spacemonkeygo/errors/errhttp"
	"golang.org/x/net/context"
	"gopkg.in/webhelp.v1"
	"gopkg.in/webhelp.v1/whcompat"
	"gopkg.in/webhelp.v1/whroute"
)
var (
	HTTPError = errors.NewClass("HTTP Error", errors.NoCaptureStack())
	BadRequest                   = ErrorClass(http.StatusBadRequest)
	Unauthorized                 = ErrorClass(http.StatusUnauthorized)
	Forbidden                    = ErrorClass(http.StatusForbidden)
	NotFound                     = ErrorClass(http.StatusNotFound)
	MethodNotAllowed             = ErrorClass(http.StatusMethodNotAllowed)
	NotAcceptable                = ErrorClass(http.StatusNotAcceptable)
	RequestTimeout               = ErrorClass(http.StatusRequestTimeout)
	Conflict                     = ErrorClass(http.StatusConflict)
	Gone                         = ErrorClass(http.StatusGone)
	LengthRequired               = ErrorClass(http.StatusLengthRequired)
	PreconditionFailed           = ErrorClass(http.StatusPreconditionFailed)
	RequestEntityTooLarge        = ErrorClass(http.StatusRequestEntityTooLarge)
	RequestURITooLong            = ErrorClass(http.StatusRequestURITooLong)
	UnsupportedMediaType         = ErrorClass(http.StatusUnsupportedMediaType)
	RequestedRangeNotSatisfiable = ErrorClass(http.StatusRequestedRangeNotSatisfiable)
	ExpectationFailed            = ErrorClass(http.StatusExpectationFailed)
	Teapot                       = ErrorClass(http.StatusTeapot)
	InternalServerError          = ErrorClass(http.StatusInternalServerError)
	NotImplemented               = ErrorClass(http.StatusNotImplemented)
	BadGateway                   = ErrorClass(http.StatusBadGateway)
	ServiceUnavailable           = ErrorClass(http.StatusServiceUnavailable)
	GatewayTimeout               = ErrorClass(http.StatusGatewayTimeout)
	errHandler = webhelp.GenSym()
)
func ErrorClass(code int) *errors.ErrorClass {
	msg := http.StatusText(code)
	if msg == "" {
		msg = "Unknown error"
	}
	return HTTPError.NewClass(msg, errhttp.SetStatusCode(code))
}