I think the error code string should match the same strings that are used in i18n. This would also simplify the code a lot.