code: def add_exception_handler(self, exception_type, error_handler, versions=(None, )):
          
          versions = (versions, ) if not isinstance(versions, (tuple, list)) else versions
          if not hasattr(self, '_exception_handlers'):
              self._exception_handlers = {}
  
          for version in versions:
              placement = self._exception_handlers.setdefault(version, OrderedDict())
              placement[exception_type] = (error_handler, ) + placement.get(exception_type, tuple())
docs: Adds a error handler to the hug api