Fix bug, InvalidInputError not defined.
Add method to retrieve the DomainError as a dict.