If you are keeping this, have this read from the json, that way changes to one file are reflected in the other and it's not a maintenance nightmare.

This seems like more reason not to use error codes, because every transform implementation is going to be incredibly coupled to the definition.