throw exception on error (issue #2)