afm-run: improve error diagnostic