Task/improve error handling

#### Reviewers
@jesuspg
#### Description
#### Testing
Unit tests passed.
Acceptance tests passed.