Opt for a simple one-liner error messages, instead of meaningless stack trace (it's most of the time about qubesd responding with error, so the stack trace of actual problem is elsewhere).
The code is mostly copied from core-admin. QubesOS/qubes-issues#1214