Skip to content

Commit

Permalink
change error log to error.message
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Mar 24, 2024
1 parent 4f36d9c commit f7bfcb0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ function advertisementRegister({
});
handleClose();
}
} catch (error) {
toast.error('An error occured, could not create new advertisement');
console.log('error occured', error);
} catch (error: unknown) {
if (error instanceof Error) {
toast.error(error.message);
console.log(error.message);
}
}
};
const handleUpdate = async (): Promise<void> => {
Expand Down Expand Up @@ -181,8 +183,11 @@ function advertisementRegister({
refetch();
handleClose();
}
} catch (error: any) {
toast.error(error.message);
} catch (error: unknown) {
if (error instanceof Error) {
toast.error(error.message);
console.log(error.message);
}
}
};
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ function organizationActionItems(): JSX.Element {
actionItemsRefetch();
hideCreateModal();
toast.success(t('successfulCreation'));
} catch (error: any) {
toast.error(error.message);
console.log(error.message);
} catch (error: unknown) {
if (error instanceof Error) {
toast.error(error.message);
console.log(error.message);
}
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function organizationDashboard(): JSX.Element {

useEffect(() => {
if (errorOrg || errorPost || errorEvent) {
console.log('error', errorPost);
console.log('error', errorPost?.message);
navigate('/orglist');
}
}, [errorOrg, errorPost, errorEvent]);
Expand Down

0 comments on commit f7bfcb0

Please sign in to comment.