projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a249b6d
)
import_export - Added some error handling
author
Joar Wandborg
<git@wandborg.com>
Fri, 14 Oct 2011 01:15:50 +0000
(
03:15
+0200)
committer
Joar Wandborg
<git@wandborg.com>
Fri, 14 Oct 2011 01:15:50 +0000
(
03:15
+0200)
We still want to be able to do an export if a file can't be read
mediagoblin/gmg_commands/import_export.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/gmg_commands/import_export.py
b/mediagoblin/gmg_commands/import_export.py
index 05edbfc80f918a2b7932d30f6c7baf304f75fd14..fefbdb4eac811a5c571e25cdea6409cb74254a3f 100644
(file)
--- 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')