2020-02-18 08:57:00 +01:00
|
|
|
import { i18n } from "@/utils/i18n";
|
2019-10-13 13:56:24 +02:00
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
export const refreshSuggestion = i18n.t("Please refresh the page and retry.") as string;
|
2019-10-13 13:56:24 +02:00
|
|
|
|
|
|
|
export const defaultError: IError = {
|
|
|
|
match: / /,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("An error has occurred.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
};
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
export interface IError {
|
|
|
|
match: RegExp;
|
|
|
|
value: string | null;
|
|
|
|
suggestRefresh?: boolean;
|
|
|
|
}
|
2019-10-13 13:56:24 +02:00
|
|
|
|
|
|
|
export const errors: IError[] = [
|
|
|
|
{
|
|
|
|
match: /^Event with UUID .* not found$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Page not found") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
suggestRefresh: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Event not found$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Event not found.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Event with this ID .* doesn't exist$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Event not found.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Error while saving report$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Error while saving report.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Participant already has role rejected$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Participant already was rejected.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Participant already has role participant$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Participant has already been approved as participant.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^You are already a participant of this event$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("You are already a participant of this event.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /NetworkError when attempting to fetch resource.$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t("Error while communicating with the server.") as string,
|
2019-10-13 13:56:24 +02:00
|
|
|
},
|
2019-10-13 16:24:43 +02:00
|
|
|
{
|
|
|
|
match: /Provided moderator actor ID doesn't have permission on this event$/,
|
2020-02-18 08:57:00 +01:00
|
|
|
value: i18n.t(
|
|
|
|
"The current identity doesn't have any permission on this event. You should probably change it."
|
|
|
|
) as string,
|
2019-10-13 16:24:43 +02:00
|
|
|
suggestRefresh: false,
|
|
|
|
},
|
2019-12-17 12:09:24 +01:00
|
|
|
{
|
|
|
|
match: /Your email is not on the whitelist$/,
|
|
|
|
value: i18n.t("Your email is not whitelisted, you can't register.") as string,
|
|
|
|
suggestRefresh: false,
|
|
|
|
},
|
2019-11-05 18:15:59 +01:00
|
|
|
{
|
|
|
|
match: /Cannot remove the last identity of a user/,
|
|
|
|
value: i18n.t("You can't remove your last identity.") as string,
|
|
|
|
suggestRefresh: false,
|
|
|
|
},
|
2019-10-13 17:03:48 +02:00
|
|
|
{
|
2019-10-15 18:13:05 +02:00
|
|
|
match: /^No user with this email was found$/,
|
2019-10-13 17:03:48 +02:00
|
|
|
value: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Username is already taken$/,
|
|
|
|
value: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^Impossible to authenticate, either your email or password are invalid.$/,
|
|
|
|
value: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^No user to validate with this email was found$/,
|
|
|
|
value: null,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match: /^This email is already used.$/,
|
|
|
|
value: null,
|
|
|
|
},
|
2019-10-15 18:13:05 +02:00
|
|
|
{
|
|
|
|
match: /^User account not confirmed$/,
|
|
|
|
value: null,
|
|
|
|
},
|
2019-10-13 13:56:24 +02:00
|
|
|
];
|