Datasource Config: Return error object on failed updates (again) (#89906)

* refactor(datasource): only pass back the error information when rejecting ds updates

* revert(datasource): remove stray console import

* refactor(datasource-config): update traceId to traceID
This commit is contained in:
Jack Westbrook 2024-07-04 16:44:49 +02:00 committed by GitHub
parent be98ab1111
commit 965cdef855
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -276,8 +276,8 @@ export function updateDataSource(dataSource: DataSourceSettings) {
const formattedError = parseHealthCheckError(err);
dispatch(testDataSourceFailed(formattedError));
return Promise.reject(err);
const errorInfo = isFetchError(err) ? err.data : { message: 'An unexpected error occurred.', traceID: '' };
return Promise.reject(errorInfo);
}
await getDatasourceSrv().reload();