Commit 805a82e3 authored by Ivan Tyagov's avatar Ivan Tyagov

Try to convert only if not already converted.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@29850 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f56fc0b9
...@@ -59,25 +59,28 @@ from xmlrpclib import Fault\n ...@@ -59,25 +59,28 @@ from xmlrpclib import Fault\n
from socket import error as SocketError\n from socket import error as SocketError\n
\n \n
message = None\n message = None\n
try:\n if context.getExternalProcessingState()!=\'converted\':\n
return context.convertToBaseFormat()\n # try to convert to base format only if not already done\n
except ConflictError:\n try:\n
raise\n return context.convertToBaseFormat()\n
except ConversionError, e:\n except ConflictError:\n
message = \'Conversion Error: %s\' % (str(e) or \'undefined.\')\n raise\n
except Fault, e:\n except ConversionError, e:\n
message = \'XMLFault: %s\' % (repr(e) or \'undefined.\')\n message = \'Conversion Error: %s\' % (str(e) or \'undefined.\')\n
except SocketError, e:\n except Fault, e:\n
message = \'Socket Error: %s\' % (repr(e) or \'undefined.\')\n message = \'XMLFault: %s\' % (repr(e) or \'undefined.\')\n
except Exception, e:\n except SocketError, e:\n
message = \'Problem: %s\' % (repr(e) or \'undefined.\')\n message = \'Socket Error: %s\' % (repr(e) or \'undefined.\')\n
except:\n except Exception, e:\n
message = \'Problem: unknown\'\n message = \'Problem: %s\' % (repr(e) or \'undefined.\')\n
# reach here, then exception was raised.\n except:\n
# message must be logged in workflow.\n message = \'Problem: unknown\'\n
context.processFile(comment=message)\n \n
# try again.\n # reach here, then exception was raised.\n
context.activate(priority=3).convertToBaseFormat()\n # message must be logged in workflow.\n
context.processFile(comment=message)\n
# try again.\n
context.activate(priority=3).convertToBaseFormat()\n
return message\n return message\n
</string> </value> </string> </value>
</item> </item>
......
1043 1044
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment