Wrap version detection in try block