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

Display proper error for message not found #738

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/aleph/vm/orchestrator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Any

import msgpack
from aiohttp import web
from aiohttp import ClientResponseError, web
from aiohttp.web_exceptions import (
HTTPBadGateway,
HTTPBadRequest,
Expand Down Expand Up @@ -88,6 +88,12 @@
logger.exception(error)
pool.forget_vm(vm_hash=vm_hash)
raise HTTPInternalServerError(reason="Host did not respond to ping") from error
except ClientResponseError as error:
logger.exception(error)

Check warning on line 92 in src/aleph/vm/orchestrator/run.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/orchestrator/run.py#L91-L92

Added lines #L91 - L92 were not covered by tests
if error.status == 404:
raise HTTPInternalServerError(reason=f"Item hash {vm_hash} not found") from error

Check warning on line 94 in src/aleph/vm/orchestrator/run.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/orchestrator/run.py#L94

Added line #L94 was not covered by tests
else:
raise HTTPInternalServerError(reason=f"Error downloading {vm_hash}") from error

Check warning on line 96 in src/aleph/vm/orchestrator/run.py

View check run for this annotation

Codecov / codecov/patch

src/aleph/vm/orchestrator/run.py#L96

Added line #L96 was not covered by tests
except Exception as error:
logger.exception(error)
pool.forget_vm(vm_hash=vm_hash)
Expand Down
Loading