Forward any raised exceptions across a channel.
(self, g)
| 162 | g.start() |
| 163 | |
| 164 | def _complete_execution(self, g): |
| 165 | """Forward any raised exceptions across a channel.""" |
| 166 | |
| 167 | # Triggered via completion callback. |
| 168 | # |
| 169 | # Runs in its own greenlet, so take care to forward the |
| 170 | # exception, if any, to fail the entire transfer in event of |
| 171 | # trouble. |
| 172 | assert g.ready() |
| 173 | self.greenlets.remove(g) |
| 174 | |
| 175 | placed = UserCritical(msg='placeholder bogus exception', |
| 176 | hint='report a bug') |
| 177 | |
| 178 | if g.successful(): |
| 179 | try: |
| 180 | segment = g.get() |
| 181 | |
| 182 | if not segment.explicit: |
| 183 | segment.mark_done() |
| 184 | except BaseException as e: |
| 185 | # Absorb and forward exceptions across the channel. |
| 186 | placed = e |
| 187 | else: |
| 188 | placed = None |
| 189 | else: |
| 190 | placed = g.exception |
| 191 | |
| 192 | self.wait_change.put(placed) |
nothing calls this directly
no test coverage detected