mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
13 lines
415 B
JavaScript
13 lines
415 B
JavaScript
// Display an alert to the user based on the http status
|
|
|
|
export default function showHttpError(status) {
|
|
// Note that other 4xx errors will be handled differently.
|
|
if (status == 401) {
|
|
alert(I18n.t("errors.unauthorized.message"));
|
|
} else if (status === undefined) {
|
|
alert(I18n.t("errors.network_error.message"));
|
|
} else if (status >= 500) {
|
|
alert(I18n.t("errors.general_error.message"));
|
|
}
|
|
}
|