capture non-empty buffer for exception response.
only set request when it is not false.