Skip to content

edit: fail if host not found #28

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions boostedblob/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ async def edit(path: str, read_only: bool = False) -> None:
async with bbb.BoostExecutor(DEFAULT_CONCURRENCY) as executor:
try:
await bbb.copyfile(path_obj, local, executor)
except bbb.request.HostNotFoundError:
raise
except FileNotFoundError:
print("File not found, creating new file...")
with open(local, "w"):
Expand Down
3 changes: 3 additions & 0 deletions boostedblob/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
from .xml import dict_to_xml, etree


class HostNotFoundError(FileNotFoundError): ...


@dataclass(frozen=True)
class RawRequest:
method: str
Expand Down