google: add utilities supporting upcoming oauth2 functionality
These are used to support some extended utilities to help with STS requests. Change-Id: Iafc145b06ca42374cfc2ac6572762a50bcf560f2 GitHub-Last-Rev: 3085fe570382318e6690304640751bf312e1a0b8 GitHub-Pull-Request: golang/oauth2#439 Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/259777 Trust: Cody Oss <codyoss@google.com> Run-TryBot: Cody Oss <codyoss@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
This commit is contained in:
18
google/internal/externalaccount/err.go
Normal file
18
google/internal/externalaccount/err.go
Normal file
@@ -0,0 +1,18 @@
|
||||
// Copyright 2020 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package externalaccount
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Error for handling OAuth related error responses as stated in rfc6749#5.2.
|
||||
type Error struct {
|
||||
Code string
|
||||
URI string
|
||||
Description string
|
||||
}
|
||||
|
||||
func (err *Error) Error() string {
|
||||
return fmt.Sprintf("got error code %s from %s: %s", err.Code, err.URI, err.Description)
|
||||
}
|
||||
Reference in New Issue
Block a user