afs: Improve error diagnostics.