(self, typ, exc, tb)
| 300 | pass |
| 301 | |
| 302 | def __exit__(self, typ, exc, tb): |
| 303 | if not exc or not isinstance(exc, errors.OpError): |
| 304 | return False |
| 305 | message = compat.as_text(exc.message) |
| 306 | _, tags = error_interpolation.parse_message(message) |
| 307 | g = None |
| 308 | func_stack = [] |
| 309 | for t in tags: |
| 310 | if t.type == "function_node": |
| 311 | # TODO(mdan): Tests should cover this. |
| 312 | if t.name == compat.as_str(self._func.name): |
| 313 | g = self._func.graph |
| 314 | elif g: |
| 315 | next_func = g._get_function(t.name) |
| 316 | if next_func is not None and isinstance(next_func, |
| 317 | _EagerDefinedFunction): |
| 318 | g = next_func.graph |
| 319 | if g: |
| 320 | func_stack.append(g.name) |
| 321 | else: |
| 322 | func_stack.append("<unknown>") |
| 323 | if g: |
| 324 | message = error_interpolation.interpolate(message, g) |
| 325 | message += "\n\nFunction call stack:\n" |
| 326 | message += " -> ".join(func_stack) |
| 327 | message += "\n" |
| 328 | exc._message = message # pylint: disable=protected-access |
| 329 | return False |
| 330 | |
| 331 | |
| 332 | def _forward_name(n): |
nothing calls this directly
no test coverage detected