mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/promauth: add more context to errors returned by Options.NewConfig() in order to simplify troubleshooting
This commit is contained in:
parent
160cc9debd
commit
01f9edda64
1 changed files with 3 additions and 3 deletions
|
@ -582,18 +582,18 @@ func (opts *Options) NewConfig() (*Config, error) {
|
||||||
return nil, fmt.Errorf("cannot simultaneously use `authorization`, `basic_auth, `bearer_token` and `ouath2`")
|
return nil, fmt.Errorf("cannot simultaneously use `authorization`, `basic_auth, `bearer_token` and `ouath2`")
|
||||||
}
|
}
|
||||||
if err := actx.initFromOAuth2Config(baseDir, opts.OAuth2); err != nil {
|
if err := actx.initFromOAuth2Config(baseDir, opts.OAuth2); err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("cannot initialize oauth2: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var tctx tlsContext
|
var tctx tlsContext
|
||||||
if opts.TLSConfig != nil {
|
if opts.TLSConfig != nil {
|
||||||
if err := tctx.initFromTLSConfig(baseDir, opts.TLSConfig); err != nil {
|
if err := tctx.initFromTLSConfig(baseDir, opts.TLSConfig); err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("cannot initialize tls: %w", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
headers, err := parseHeaders(opts.Headers)
|
headers, err := parseHeaders(opts.Headers)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("cannot parse headers: %w", err)
|
||||||
}
|
}
|
||||||
hd := xxhash.New()
|
hd := xxhash.New()
|
||||||
for _, kv := range headers {
|
for _, kv := range headers {
|
||||||
|
|
Loading…
Reference in a new issue