| When a macro parameter is invalid, the macro is replaced by "Invalid macro parameters used for the [macro] macro." followed by the message of the root cause of the exception. That message is written for developers. It does not say which parameter is wrong or what value is expected, so on a macro with several parameters the user has to guess which one to fix. Steps to reproduce
- Edit a page with the wiki editor.
- Add {{toc depth="0"/}}, {{toc scope="abc"/}} and {{translation key="core.menu.create" locale="xx_bogus"/}}.
- Save and view the page.
Expected Each error names the parameter, the value given and what is accepted, for example "The value [0] of the [depth] parameter must be greater than or equal to 1." Actual
- depth="0": "Cause: [Failed to validate bean: [must be greater than or equal to 1]]"
- scope="abc": "Cause: [Unable to convert value [abc]. Allowed values are (case insensitive) "LOCAL" or "PAGE".]"
- locale="xx_bogus": "Cause: [Invalid locale format: xx_bogus]"
The parameter name is known when the error happens: DefaultBeanManager wraps a conversion failure in "Failed to populate property [name]", but the error box only shows the root cause, so that part is lost. A failed @Min or @Pattern constraint only keeps the message of the first violation, without its property path. The WYSIWYG usability audit of the macros found this on most of the 58 macros failing its error criterion. |