These are chat archives for gin-gonic/gin

14th
Jul 2015
Jamie Stackhouse
@itsjamie
Jul 14 2015 11:58
I just updated Gin, and I noticed that Errors are no longer printed to Stdout when I call AbortWithError.
if err != nil || token.Valid == false {
    c.AbortWithError(http.StatusUnauthorized, err)
    return
}

err is type error.

I took a look at the call to c.Error() and I see this ErrorTypePrivate now, and it looks like the logger only outputs Errors that are typed as private? Is that right?

Oh.. it's because the package I'm calling returns it as *jwt.ValidationError, so the type switch in c.Error probably just uses the *error case, which doesn't set the private flag?
Jamie Stackhouse
@itsjamie
Jul 14 2015 12:17
Ahem, I apologize. Surprisingly, it helps if you have router.Use(gin.Logger()) in the code.