Why catch raw Exception? This may also not ensure out is closed.