Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions connector_flow/task/abstract_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp.addons.connector.session import ConnectorSession
from openerp import _
import simplejson
from base64 import b64encode, b64decode

from openerp import _
from openerp.addons.connector.session import ConnectorSession


class AbstractTask(object):

Expand Down Expand Up @@ -96,7 +96,10 @@ def run(self, chunk_id=None, **kwargs):
except:
raise
finally:
chunk.write({'state': new_state})
try:
chunk.write({'state': new_state})
except:
pass
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not correct. If an error occurs during writing the state to the chunk I think the whole transaction will roll back, so it's missleading to silently catch the exeption here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but now if any error happens in read_chunk(), final error is not what happen there, but error related with failed chunk write. In such case it's hard to understand why read_chunck() failed (found out it while writing unit tests).

return result

def read_chunk(self, **kwargs):
Expand Down