error.code is the machine-readable cause (unsupported_document, insufficient_credits, …).
Branch on type and code; show message to a human rather than parsing it.
A request for an id that belongs to another workspace returns 404, not 403. Confirming that
an id exists is itself a leak.