From http://stackoverflow.com/questions/21353945/is-there-a-way-to-test-argument-errors-from-within-a-method-to-return-true-or-fa