DEV: Improve postcss error handling (#31420)

Followup to 087e8e4bdb53f71930ec5c930c463c37dd2bd58d

- Fixes the variable-prefixer so it doesn't explode when the input is
unparseable
- Add URL polyfills so that postcss can print its errors properly
- Catch postcss errors in the same way as sass errors
This commit is contained in:
David Taylor
2025-02-20 16:48:22 +00:00
committed by GitHub
parent a26138b501
commit 834ea70b1c
8 changed files with 30 additions and 3 deletions

View File

@ -49,7 +49,7 @@ class Stylesheet::Manager::Builder
load_paths: load_paths,
dark: @dark,
)
rescue SassC::SyntaxError, SassC::NotRenderedError => e
rescue SassC::SyntaxError, SassC::NotRenderedError, DiscourseJsProcessor::TranspileError => e
if Stylesheet::Importer::THEME_TARGETS.include?(@target.to_s)
# no special errors for theme, handled in theme editor
["", nil]