mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix error source for clientSecret not found
error (#96771)
* Fix error source for clientSecret not found errir * Use errors.New as we are not formatting the error
This commit is contained in:
parent
1f37311de4
commit
6b5a05486b
@ -3,6 +3,7 @@ package azuremonitor
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ func newHTTPClient(ctx context.Context, route types.AzRoute, model types.Datasou
|
|||||||
// Use Azure credentials if the route has OAuth scopes configured
|
// Use Azure credentials if the route has OAuth scopes configured
|
||||||
if len(route.Scopes) > 0 {
|
if len(route.Scopes) > 0 {
|
||||||
if cred, ok := model.Credentials.(*azcredentials.AzureClientSecretCredentials); ok && cred.ClientSecret == "" {
|
if cred, ok := model.Credentials.(*azcredentials.AzureClientSecretCredentials); ok && cred.ClientSecret == "" {
|
||||||
return nil, fmt.Errorf("unable to initialize HTTP Client: clientSecret not found")
|
return nil, backend.DownstreamError(errors.New("unable to initialize HTTP Client: clientSecret not found"))
|
||||||
}
|
}
|
||||||
|
|
||||||
authOpts := azhttpclient.NewAuthOptions(azureSettings)
|
authOpts := azhttpclient.NewAuthOptions(azureSettings)
|
||||||
|
Loading…
Reference in New Issue
Block a user