Refactor validation errors #4568
Labels
Compatibility Tool
Developer Tools for AMP Debugging
Epic
Groomed
P2
Low priority
Sanitizers
WS:Perf
Work stream for Metrics, Performance and Optimizer
The creation, storage, communication and presentation of validation errors has organically grown with the scope of the plugin.
Right now, validation errors are passed around as arbitrarily structured arrays that contain multiple values, and the representation needs to be manually kept in sync with the different types of errors to be able to make sense of the data structure.
The entire system around validation errors needs to be redesigned to provide a sane public interface that we can provide in the future generic PHP libraries for the sanitizer and the validator.
A good first step is the error handling in the optimizer library. This should be extracted into either the
ampproject/common
library or a separate library and expanded to cover all phases of AMP usage.The text was updated successfully, but these errors were encountered: