mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-10-04 01:31:33 +03:00
refactor: replace aliased OSError subclasses
This commit is contained in:
parent
7d0be62da8
commit
d356a68987
@ -338,7 +338,7 @@ def save_markdown(content: str, filename: str = "netmiko_devices.md") -> None:
|
|||||||
with open(output_path, "w", encoding="utf-8") as f:
|
with open(output_path, "w", encoding="utf-8") as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
print(f"Markdown document saved to: {output_path}")
|
print(f"Markdown document saved to: {output_path}")
|
||||||
except IOError as e:
|
except OSError as e:
|
||||||
print(f"Error: Failed to save Markdown file: {e}", file=sys.stderr)
|
print(f"Error: Failed to save Markdown file: {e}", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|||||||
@ -577,7 +577,7 @@ async def get_file(file_path: str, node: Node = Depends(dep_node)) -> Response:
|
|||||||
try:
|
try:
|
||||||
async for chunk in compute_resp.content.iter_chunked(65536):
|
async for chunk in compute_resp.content.iter_chunked(65536):
|
||||||
yield chunk
|
yield chunk
|
||||||
except (IOError, OSError, asyncio.TimeoutError) as e:
|
except (OSError, asyncio.TimeoutError) as e:
|
||||||
log.error(f"Error streaming file '{path}' from compute: {e}")
|
log.error(f"Error streaming file '{path}' from compute: {e}")
|
||||||
raise
|
raise
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user