Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix is not found error #227

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

jakubno
Copy link
Member

@jakubno jakubno commented Dec 20, 2024

Description

Handle missing check

Description by Callstackai

This PR modifies the error handling in the GetLastSnapshot function to properly handle cases where a snapshot is not found.

Diagrams of code changes
sequenceDiagram
    participant Caller
    participant SnapshotHandler
    participant Database

    Caller->>SnapshotHandler: Get Snapshot Build
    SnapshotHandler->>Database: Query for snapshot
    
    alt Error occurs
        Database-->>SnapshotHandler: Returns error
        SnapshotHandler-->>Caller: Return "failed to get snapshot build" error
    else Not Found
        Database-->>SnapshotHandler: Returns NotFound
        SnapshotHandler-->>Caller: Return "no snapshot build found" error
    else Success
        Database-->>SnapshotHandler: Returns snapshot data
        SnapshotHandler-->>Caller: Return snapshot and build
    end
Loading
Files Changed
FileSummary
packages/shared/pkg/db/snapshot.goUpdated error handling to return a specific message when no snapshot build is found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant