Altered Error type to use codes