Skip to content

Commit 87f875f

Browse files
authored
Allow hand-polishing individual exception classes, and commit generated files. (#38)
2 parents c4b16ee + 9daab77 commit 87f875f

26 files changed

Lines changed: 787 additions & 121 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ __pycache__
55

66
# Generated code
77
/stubs/
8-
/fastly_compute/exceptions/*
9-
!/fastly_compute/exceptions/__init__.py
10-
/fastly_compute/runtime_patching/patches.py
118

129
# Build artifacts
1310
/build/

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ $(BUILD_DIR)/%.composed.wasm: wit/viceroy.wit wit/deps/fastly/compute.wit fastly
6161
# The script that writes the exceptions and the patches always rewrites
6262
# everything, so we can depend on the mod date of only 1 file. We choose
6363
# patches.py, because its name doesn't depend on the WIT contents.
64-
fastly_compute/runtime_patching/patches.py: scripts/generate_patches/*.py $(COMPUTE_WIT)
64+
fastly_compute/runtime_patching/patches.py: scripts/generate_patches/*.py $(shell find scripts/generate_patches/templates -name "*.jinja") $(COMPUTE_WIT)
6565
uv run python -m scripts.generate_patches
6666

6767
# Create build directory

examples/backend-requests/uv.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/bottle-app/uv.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/flask-app/uv.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/game-of-life/uv.lock

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
"""Blocklists using [Access Control Lists] (ACLs)
2+
3+
[Access Control Lists]: https://www.fastly.com/documentation/reference/api/acls/
4+
"""
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# This file is automatically generated by generate_patches.
2+
# It is not intended for manual editing.
3+
"""Errors returned on ACL lookup failure."""
4+
5+
from fastly_compute.exceptions import FastlyError
6+
7+
8+
class AclError(FastlyError):
9+
"""Errors returned on ACL lookup failure."""
10+
11+
12+
class TooManyRequests(AclError):
13+
"""Too many requests have been made.
14+
15+
This corresponds to an HTTP error code of 429, “Too Many Requests”.
16+
"""
17+
18+
19+
class GenericError(AclError):
20+
"""Generic error value.
21+
22+
This means that some unexpected error occurred.
23+
"""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""HTTP bodies."""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is automatically generated by generate_patches.
2+
# It is not intended for manual editing.
3+
"""Trailers aren't available until the body has been completely transmitted, so this error
4+
type can either indicate that the errors aren't available yet, or that an error occurred.
5+
"""
6+
7+
from fastly_compute.exceptions import FastlyError
8+
9+
10+
class TrailerError(FastlyError):
11+
"""Trailers aren't available until the body has been completely transmitted, so this error
12+
type can either indicate that the errors aren't available yet, or that an error occurred.
13+
"""
14+
15+
16+
class NotAvailableYet(TrailerError):
17+
"""The trailers aren't available yet."""
18+
19+
20+
class Error(TrailerError):
21+
"""An error occurred."""

0 commit comments

Comments
 (0)