(PUP-3561) add exception catch and wrapping into known exception type

This came out of testing for Stdlib and the validate_cmd function, it was a negative acceptance testcase where we try to validate an invalid command and should throw fail and return false, when seeing the exception thrown instead of Puppet::Error we found it further up the pipe.