changed the structure of the errors lib to be about functions extended from Error