You need to wrap this in try/catch as it might throw internally in a couple of places.