Define proper classes for all errors instead of using metaprogramming