docs: def to_dict(self) -> Dict[str, Any]:
          """
          Creates a dictionary-based description of this exception, ready to be
          serialised as JSON or YAML.
          """
          jsn = {
              'kind': self.__class__.__name__,
              'message': self.message
          } # type: Dict[str, Any]
          data = self.data
          if data:
              jsn['data'] = data
          jsn = {'error': jsn}
          return jsn