diff --git a/public/app/features/admin/state/actions.ts b/public/app/features/admin/state/actions.ts index 93501db91d86..06fda51b6af0 100644 --- a/public/app/features/admin/state/actions.ts +++ b/public/app/features/admin/state/actions.ts @@ -38,6 +38,7 @@ export function loadLdapState(): ThunkResult { const connectionInfo = await getLdapState(); dispatch(ldapConnectionInfoLoadedAction(connectionInfo)); } catch (error) { + error.isHandled = true; const ldapError = { title: error.data.message, body: error.data.error, @@ -63,6 +64,7 @@ export function loadUserMapping(username: string): ThunkResult { const userInfo = await getUserInfo(username); dispatch(userMappingInfoLoadedAction(userInfo)); } catch (error) { + error.isHandled = true; const userError = { title: error.data.message, body: error.data.error, @@ -106,6 +108,7 @@ export function loadLdapUserInfo(userId: number): ThunkResult { dispatch(loadUserSessions(userId)); dispatch(loadUserMapping(user.login)); } catch (error) { + error.isHandled = true; const userError = { title: error.data.message, body: error.data.error, diff --git a/public/app/features/admin/state/apis.ts b/public/app/features/admin/state/apis.ts index f7194c620863..ea416ad4d356 100644 --- a/public/app/features/admin/state/apis.ts +++ b/public/app/features/admin/state/apis.ts @@ -47,18 +47,14 @@ export const syncLdapUser = async (userId: number) => { }; export const getUserInfo = async (username: string): Promise => { - try { - const response = await getBackendSrv().get(`/api/admin/ldap/${username}`); - const { name, surname, email, login, isGrafanaAdmin, isDisabled, roles, teams } = response; - return { - info: { name, surname, email, login }, - permissions: { isGrafanaAdmin, isDisabled }, - roles, - teams, - }; - } catch (error) { - throw error; - } + const response = await getBackendSrv().get(`/api/admin/ldap/${username}`); + const { name, surname, email, login, isGrafanaAdmin, isDisabled, roles, teams } = response; + return { + info: { name, surname, email, login }, + permissions: { isGrafanaAdmin, isDisabled }, + roles, + teams, + }; }; export const getUser = async (id: number): Promise => {