Skip to content

Commit

Permalink
Don't suppress uncaught exceptions when performance monitoring is dis…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
droserasprout committed Nov 13, 2023
1 parent 575b436 commit 7dfbeee
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,15 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic

### Added

- evm.node: Requesting logs for multiple blocks at once for EVM nodes to improve performance
- evm.subsquid: Added metrics for Subsquid Cloud deploy.
- evm.subsquid: Added Prometheus metrics required for Subsquid Cloud deployments.

### Fixed

- cli: Don't suppress uncaught exceptions when performance monitoring is disabled.

### Performance

- evm.subsquid.events: Request logs in batches to speed up the last mile indexing.

### Security

Expand Down
10 changes: 4 additions & 6 deletions src/dipdup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def red_echo(message: str) -> None:
echo(message, err=True, fg='red')


def _print_help(error: Exception, report_id: str) -> None:
def _print_help_atexit(error: Exception, report_id: str) -> None:
"""Prints a helpful error message after the traceback"""
from dipdup.exceptions import Error

Expand Down Expand Up @@ -123,12 +123,10 @@ async def wrapper(ctx: click.Context, *args: Any, **kwargs: Any) -> None:
except Exception as e:
package = ctx.obj.config.package if ctx.obj else 'unknown'
report_id = save_report(package, e)
_print_help(e, report_id)

if metrics:
raise e
sys.exit(1)
_print_help_atexit(e, report_id)
raise e

# NOTE: If indexing was interrupted by signal, save report with just performance metrics.
if fn.__name__ == 'run':
package = ctx.obj.config.package
save_report(package, None)
Expand Down

0 comments on commit 7dfbeee

Please sign in to comment.