Catch exception when testing within Travis-CI