afm-main-plugin: improves error reporting