I think `if isinstance(e, DomainError):` would be better