Add try catch for event type duplicate, fixed catch error loggin (#6130)
Co-authored-by: Peer Richelsen <[email protected]>
This commit is contained in:
1 parent
49bf14b196
commit
9487819ec1
2 files changed
+104
-101
No files matched your search
@@ -43,12 +43,12 @@ const DuplicateDialog = () => {
|
||||
showToast(message, "error");
|
||||
}
|
||||
|
||||
if (err.data?.code === "BAD_REQUEST") {
|
||||
const message = `${err.data.code}: URL already exists.`;
|
||||
if (err.data?.code === "INTERNAL_SERVER_ERROR" || err.data?.code === "BAD_REQUEST") {
|
||||
const message = t("unexpected_error_try_again");
|
||||
showToast(message, "error");
|
||||
}
|
||||
|
||||
if (err.data?.code === "UNAUTHORIZED") {
|
||||
if (err.data?.code === "UNAUTHORIZED" || err.data?.code === "FORBIDDEN") {
|
||||
const message = `${err.data.code}: You are not able to create this event`;
|
||||
showToast(message, "error");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user