Replaced error() fn with MyError class

o Using a class allows me to intercept some errors