better error message in XDI/JSON