Correctly declaring error domain