@Override
public boolean handleFailure(FrontendRestApi api, FailureReason failure, ServerError errorDto) {
switch (failure) {
case INVALID_XSRF_TOKEN:
// Update our XSRF token.
InvalidXsrfTokenServerError xsrfError = (InvalidXsrfTokenServerError) errorDto;
BootstrapSession.getBootstrapSession().setXsrfToken(xsrfError.getNewXsrfToken());
api.initCustomHeaders();
return true;
case CLIENT_FRONTEND_VERSION_SKEW:
// Display a message to the user that he needs to reload the client.