Skip to content

Commit ca32cdd

Browse files
committed
chore: Throw if we add a new layer but forget to support it
1 parent f60b3aa commit ca32cdd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

shiny/ui/_theme.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,13 @@ def add_sass_layer_file(self: T, path: str | pathlib.Path) -> T:
447447
add_method = getattr(self, f"add_{key}", None)
448448
if add_method:
449449
add_method("".join(value))
450+
else:
451+
# We'd get here if we add a new layer boundary name but forget to
452+
# include it in the supported `.add_{layer}()` methods.
453+
raise ValueError(
454+
f"Unsupported Sass layer: {key}. Please report this issue to the "
455+
"Shiny maintainers at https://github.com/posit-dev/py-shiny."
456+
)
450457

451458
return self
452459

0 commit comments

Comments
 (0)