Handles errors by logging them and displaying an alert message.
export const handleError = function (alert, t) { return function (error) { console.error(error); if (error.error?.toString() === "406") { alert.error(t(error.reason)); } else { alert.error(t("supra.errors.standardError")); } };}; Copy
export const handleError = function (alert, t) { return function (error) { console.error(error); if (error.error?.toString() === "406") { alert.error(t(error.reason)); } else { alert.error(t("supra.errors.standardError")); } };};
Alert object with an error method to display notifications.
error
Translation function to convert error messages into user-friendly text.
Handles errors by logging them and displaying an alert message.
Source