Return the return value of this Attempt instance or raise an Exception. If wrap_exception is true, this Attempt is wrapped inside of a RetryError before being raised.
(self, wrap_exception=False)
| 235 | self.has_exception = has_exception |
| 236 | |
| 237 | def get(self, wrap_exception=False): |
| 238 | """ |
| 239 | Return the return value of this Attempt instance or raise an Exception. |
| 240 | If wrap_exception is true, this Attempt is wrapped inside of a |
| 241 | RetryError before being raised. |
| 242 | """ |
| 243 | if self.has_exception: |
| 244 | if wrap_exception: |
| 245 | raise RetryError(self) |
| 246 | else: |
| 247 | six.reraise(self.value[0], self.value[1], self.value[2]) |
| 248 | else: |
| 249 | return self.value |
| 250 | |
| 251 | def __repr__(self): |
| 252 | if self.has_exception: |