signoz/frontend/src/hooks/useAxiosError.tsx
Palash Gupta 2e85bd0264
feat: export panel in logs explorer is added (#2993)
* feat: export panel in logs explorer is added

* chore: notification is updated when dashboard id is not found while updating

* fix: error handling for export panel

* fix: layout gap

* refactor: remove log

* fix: updating log page from update button

* fix: redirect with correct operator

* fix: redirect wioth query data

* fix: refetch list

---------

Co-authored-by: Yevhen Shevchenko <y.shevchenko@seedium.io>
2023-07-07 20:59:35 +05:30

20 lines
398 B
TypeScript

import axios from 'axios';
import { useNotifications } from './useNotifications';
const useAxiosError = (): UseAxiosError => {
const { notifications } = useNotifications();
return (error: unknown): void => {
if (axios.isAxiosError(error)) {
notifications.error({
message: error.message,
});
}
};
};
type UseAxiosError = (error: unknown) => void;
export default useAxiosError;