From: Joar Wandborg Date: Fri, 14 Oct 2011 01:15:50 +0000 (+0200) Subject: import_export - Added some error handling X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=a7ca2a72118f0e0e72bdc2a0547b80ae0d0a32ea;p=mediagoblin.git import_export - Added some error handling We still want to be able to do an export if a file can't be read --- diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py index 05edbfc8..fefbdb4e 100644 --- a/mediagoblin/gmg_commands/import_export.py +++ b/mediagoblin/gmg_commands/import_export.py @@ -215,10 +215,12 @@ def _export_media(db, args): _log.info('Exporting {0} - {1}'.format( entry['title'], name)) - - mc_file = media_cache.get_file(path, mode='wb') - mc_file.write( - mg_globals.public_store.get_file(path, mode='rb').read()) + try: + mc_file = media_cache.get_file(path, mode='wb') + mc_file.write( + mg_globals.public_store.get_file(path, mode='rb').read()) + except e: + _log.error('Failed: {0}'.format(e)) _log.info('...Media exported')