Improve error handling when executing a custorder batch
This commit is contained in:
parent
6e15d59a84
commit
3a10a4bcb7
2 changed files with 17 additions and 16 deletions
|
@ -779,9 +779,13 @@ class CustomerOrderView(MasterView):
|
|||
'batch': self.normalize_batch(batch)}
|
||||
|
||||
def submit_new_order(self, batch, data):
|
||||
result = self.execute_new_order_batch(batch, data)
|
||||
if not result:
|
||||
return {'error': "Batch failed to execute"}
|
||||
try:
|
||||
result = self.execute_new_order_batch(batch, data)
|
||||
except Exception as error:
|
||||
return {'error': six.text_type(error)}
|
||||
else:
|
||||
if not result:
|
||||
return {'error': "Batch failed to execute"}
|
||||
|
||||
next_url = None
|
||||
if isinstance(result, model.CustomerOrder):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue