Rewrite error class. New one is more flexible.