Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Commit 3fe3758

Browse files
committed
Fix actors.worker: import missing exceptions
1 parent 14f98cd commit 3fe3758

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

swf/actors/worker.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#! -*- coding:utf-8 -*-
22

3+
import boto.exception
34
from swf.actors import Actor
45
from swf.models import ActivityTask
5-
from swf.exceptions import PollTimeout
6+
from swf.exceptions import PollTimeout, ResponseError, DoesNotExistError
67

78

89
class ActivityWorker(Actor):
@@ -44,7 +45,7 @@ def cancel(self, task_token, details=None):
4445
"""
4546
try:
4647
return self.connection.respond_activity_task_canceled(task_token)
47-
except SWFResponseError as e:
48+
except boto.exception.SWFResponseError as e:
4849
if e.error_code == 'UnknownResourceFault':
4950
raise DoesNotExistError(
5051
"Unable to cancel activity task with token: {}.\n".format(task_token),
@@ -67,7 +68,7 @@ def complete(self, task_token, result=None):
6768
task_token,
6869
result
6970
)
70-
except SWFResponseError as e:
71+
except boto.exception.SWFResponseError as e:
7172
if e.error_code == 'UnknownResourceFault':
7273
raise DoesNotExistError(
7374
"Unable to complete activity task with token: {}.\n".format(task_token),
@@ -94,7 +95,7 @@ def fail(self, task_token, details=None, reason=None):
9495
details,
9596
reason
9697
)
97-
except SWFResponseError as e:
98+
except boto.exception.SWFResponseError as e:
9899
if e.error_code == 'UnknownResourceFault':
99100
raise DoesNotExistError(
100101
"Unable to fail activity task with token: {}.\n".format(task_token),
@@ -117,7 +118,7 @@ def heartbeat(self, task_token, details=None):
117118
task_token,
118119
details
119120
)
120-
except SWFResponseError as e:
121+
except boto.exception.SWFResponseError as e:
121122
if e.error_code == 'UnknownResourceFault':
122123
raise DoesNotExistError(
123124
"Unable to send activity task {} heartbeat.\n".format(task_token),
@@ -157,7 +158,7 @@ def poll(self, task_list=None, identity=None):
157158
task_list,
158159
identity=identity
159160
)
160-
except SWFResponseError as e:
161+
except boto.exception.SWFResponseError as e:
161162
if e.error_code == 'UnknownResourceFault':
162163
raise DoesNotExistError(
163164
"Unable to poll activity task.\n",

0 commit comments

Comments
 (0)