// ErrorHandler handles gin-jwt's errors from gin.Context.
ErrorHandler handles gin-jwt's errors from gin.Context.
// ErrorHandler handles gin - jwt ' s errors from gin . Context .
func ErrorHandler(c *gin.Context) {
	c.Next()
	err := Error(c)
	if err == nil {
		return
	}
	switch err {
	case ErrorAuthorizationHeaderIsEmpty,
		ErrorAuthorizationHeaderIsInvalid,
		ErrorAuthorizationTokenExpired,
		ErrorAuthenticationFailed:
		log.Println(err)
	case ErrorPermissionDenied:
		log.Println(err)
	default:
		log.Println(err)
	}
}
func ErrorHandler ( c * gin . Context ) { c . Next ( ) err := Error ( c ) if err == nil { return } switch err { case ErrorAuthorizationHeaderIsEmpty , ErrorAuthorizationHeaderIsInvalid , ErrorAuthorizationTokenExpired , ErrorAuthenticationFailed : log . Println ( err ) case ErrorPermissionDenied : log . Println ( err ) default : log . Println ( err ) } }
ErrorHandler handles gin-jwt's errors from gin.Context.
ErrorHandler handles gin - jwt ' s errors from gin . Context .
// status 401 // status 403 // status 500