Search in sources :

Example 1 with ResponseBodyData

use of com.facebook.stetho.inspector.network.ResponseBodyData in project stetho by facebook.

the class Network method readResponseBody.

private GetResponseBodyResponse readResponseBody(String requestId) throws IOException, JsonRpcException {
    GetResponseBodyResponse response = new GetResponseBodyResponse();
    ResponseBodyData bodyData;
    try {
        bodyData = mResponseBodyFileManager.readFile(requestId);
    } catch (OutOfMemoryError e) {
        throw new JsonRpcException(new JsonRpcError(JsonRpcError.ErrorCode.INTERNAL_ERROR, e.toString(), null));
    }
    response.body = bodyData.data;
    response.base64Encoded = bodyData.base64Encoded;
    return response;
}
Also used : JsonRpcError(com.facebook.stetho.inspector.jsonrpc.protocol.JsonRpcError) ResponseBodyData(com.facebook.stetho.inspector.network.ResponseBodyData) JsonRpcException(com.facebook.stetho.inspector.jsonrpc.JsonRpcException)

Aggregations

JsonRpcException (com.facebook.stetho.inspector.jsonrpc.JsonRpcException)1 JsonRpcError (com.facebook.stetho.inspector.jsonrpc.protocol.JsonRpcError)1 ResponseBodyData (com.facebook.stetho.inspector.network.ResponseBodyData)1