What about adding ex.what()? It'll differ file absence from file permissions. In Jenkins test we don't know why it failed.