ElasticSearch: Fix errorsource in newInstanceSettings (#93859)

This commit is contained in:
Isabella Siu 2024-09-27 15:40:35 -04:00 committed by GitHub
parent c2799b4901
commit 76406d65cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,11 +102,11 @@ func newInstanceSettings(httpClientProvider *httpclient.Provider) datasource.Ins
timeField, ok := jsonData["timeField"].(string)
if !ok {
return nil, errors.New("timeField cannot be cast to string")
return nil, exp.DownstreamError(errors.New("timeField cannot be cast to string"), false)
}
if timeField == "" {
return nil, errors.New("elasticsearch time field name is required")
return nil, exp.DownstreamError(errors.New("elasticsearch time field name is required"), false)
}
logLevelField, ok := jsonData["logLevelField"].(string)