client: properly serialize the `message` and `stack`

properties on the Error object that would be lost otherwise