Skip to content

Commit ac2def8

Browse files
chore: log exception details (#95)
* log exception details * doc
1 parent ca4ed5c commit ac2def8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Observe Pyth on-chain price feeds and run sanity checks on the data.
77
Container images are available at https://github.com/pyth-network/pyth-observer/pkgs/container/pyth-observer
88

99
To run Observer locally, you will need:
10-
- Python 3.10 ([pyenv](https://github.com/pyenv/pyenv) is a nice way to manage Python installs, and once installed will automatically set the version to 3.10 for this project dir via the `.python-version` file).
11-
- [Poetry](https://python-poetry.org), which handles package and virtualenv management.
10+
- Python 3.11 ([pyenv](https://github.com/pyenv/pyenv) is a nice way to manage Python installs, and once installed will automatically set the version to 3.11 for this project dir via the `.python-version` file).
11+
- [Poetry] v2.1.4 (https://python-poetry.org), which handles package and virtualenv management.
1212

1313
Install dependencies and run the service:
1414
```sh

pyth_observer/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,11 @@ async def run(self):
200200
await self.dispatch.run(states)
201201

202202
except Exception as e:
203-
logger.error(f"Error in run loop: {e}")
203+
logger.exception(f"Error in run loop: {repr(e)}")
204+
if "product" in locals():
205+
logger.error(
206+
f"Product attrs during error: {product.attrs}" # pyright: ignore[reportPossiblyUnboundVariable]
207+
)
204208
health_server.observer_ready = False
205209
metrics.loop_errors_total.labels(error_type=type(e).__name__).inc()
206210
await asyncio.sleep(5)

0 commit comments

Comments
 (0)