Make error code a class constant
Todo