Throw and handle docs exception properly