1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-04-10 01:16:39 +02:00

refactor: change error type in edit context

This commit is contained in:
Youssef 2022-02-25 13:46:14 +01:00
parent c141f91abd
commit 4898eee8d8

View File

@ -1,5 +1,6 @@
import { useEffect } from 'react'; import { useEffect } from 'react';
import { useHistory, useParams } from 'react-router-dom'; import { useHistory, useParams } from 'react-router-dom';
import { formatUnknownError } from 'utils/format-unknown-error';
import useContextsApi from '../../../hooks/api/actions/useContextsApi/useContextsApi'; import useContextsApi from '../../../hooks/api/actions/useContextsApi/useContextsApi';
import useContext from '../../../hooks/api/getters/useContext/useContext'; import useContext from '../../../hooks/api/getters/useContext/useContext';
import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig'; import useUiConfig from '../../../hooks/api/getters/useUiConfig/useUiConfig';
@ -63,8 +64,8 @@ export const EditContext = () => {
title: 'Context information updated', title: 'Context information updated',
type: 'success', type: 'success',
}); });
} catch (e: any) { } catch (e: unknown) {
setToastApiError(e.toString()); setToastApiError(formatUnknownError(e));
} }
}; };