for (const errorName in state.errors) { if (state.errors.hasOwnProperty(errorName)) { switch (errorName) {