Translating retry connection error message and fixing E2E tests

This commit is contained in:
David Négrier 2022-01-19 11:36:08 +01:00 committed by Alexis Faizeau
parent 51c3f1d972
commit 0be77164ec
7 changed files with 61 additions and 12 deletions

View file

@ -1,6 +1,7 @@
import axios from "axios";
import * as rax from "retry-axios";
import { errorStore } from "../Stores/ErrorStore";
import { _ } from "../Translator/Translator";
/**
* This instance of Axios will retry in case of an issue and display an error message as a HTML overlay.
@ -26,10 +27,13 @@ axiosWithRetry.defaults.raxConfig = {
console.log(err);
console.log(cfg);
console.log(`Retry attempt #${cfg?.currentRetryAttempt} on URL '${err.config.url}'`);
errorStore.addErrorMessage("Unable to connect to WorkAdventure. Are you connected to internet?", {
closable: false,
id: "axios_retry",
});
errorStore.addErrorMessage(
_("error.connection-retry.unable-to-connect-to-workAdventure-are-you-connected-to-internet"),
{
closable: false,
id: "axios_retry",
}
);
},
};