[BUGFIX] Catch exceptions while dumping a file