Sorry, you are right; there is probably a typo, because only a DataProviderException constructor that takes a String object is available.
Please use ex.getMessage(). We'll fix the above code.