diff --git a/access_error.go b/access_error.go index f41657388..59cc28300 100644 --- a/access_error.go +++ b/access_error.go @@ -27,7 +27,7 @@ func (c *Fosite) WriteAccessError(rw http.ResponseWriter, _ AccessRequester, err func writeJsonError(rw http.ResponseWriter, err error) { rw.Header().Set("Content-Type", "application/json;charset=UTF-8") - rfcerr := errorToRFC6749Error(err) + rfcerr := ErrorToRFC6749Error(err) js, err := json.Marshal(err) if err != nil { http.Error(rw, fmt.Sprintf(`{"error": "%s"}`, err.Error()), http.StatusInternalServerError) diff --git a/authorize_error.go b/authorize_error.go index ece1648aa..eaa41d480 100644 --- a/authorize_error.go +++ b/authorize_error.go @@ -21,7 +21,7 @@ import ( ) func (c *Fosite) WriteAuthorizeError(rw http.ResponseWriter, ar AuthorizeRequester, err error) { - rfcerr := errorToRFC6749Error(err) + rfcerr := ErrorToRFC6749Error(err) if !ar.IsRedirectURIValid() { js, err := json.MarshalIndent(rfcerr, "", "\t") if err != nil { diff --git a/errors.go b/errors.go index 358854783..bc0a6764e 100644 --- a/errors.go +++ b/errors.go @@ -177,7 +177,7 @@ const ( errRevokationClientMismatchName = "revokation_client_mismatch" ) -func errorToRFC6749Error(err error) *RFC6749Error { +func ErrorToRFC6749Error(err error) *RFC6749Error { if e, ok := err.(*RFC6749Error); ok { return e } else if e, ok := errors.Cause(err).(*RFC6749Error); ok {