Background
BlockErrorFormatter is a service for handling block error messages, instead of the block objects handling this themselves.
It was introduced as part of an (ongoing) effort to make block objects value objects; however, it made block error reporting less flexible: BlockErrorFormatter chooses the message based on characteristics about the block, but is unaware of anything introduced by extensions, e.g. the GlobalBlock type.
We can use the hook system to re-introduce this flexibility.
Acceptance criteria
- BlockErrorFormatter::getBlockErrorMessageKey runs a hook that allows extensions to check block characteristics and potentially override the chosen block error message key.