programmatically create substitution map from error codes