Skip to content

Remove all runtime panics from the code #226

@hbjydev

Description

@hbjydev

Currently, if the worker services run into any failures, they just panic their guts into stdout/stderr:

thread 'tokio-runtime-worker' panicked at cli/src/command/start/agent.rs:332:14:
failed to push: Status { code: Internal, message: "failed to write store path: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Fri, 23 May 2025 16:53:17 GMT"} }, source: None }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at cli/src/command/start/agent.rs:332:14:
failed to push: Status { code: Internal, message: "failed to write store path: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Fri, 23 May 2025 16:53:43 GMT"} }, source: None }
thread 'tokio-runtime-worker' panicked at cli/src/command/start/agent.rs:332:14:
failed to push: Status { code: Internal, message: "failed to write store path: Os { code: 2, kind: NotFound, message: \"No such file or directory\" }", metadata: MetadataMap { headers: {"content-type": "application/grpc", "date": "Fri, 23 May 2025 16:53:56 GMT"} }, source: None }

This should probably be using tracing::error!() with some kind of Result handling instead, because anyhow::bail!(...) just seems to panic outright.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions