Redefine error constant strings as error variables

As I have specified in the reddit comments, errors can be defined as error types.