Commit f2076892 authored by Honfika's avatar Honfika

Throw better exception when response has no body and the user want to read it.

parent 5a4f1af9
using System;
using System.ComponentModel;
using Titanium.Web.Proxy.Exceptions;
using Titanium.Web.Proxy.Extensions;
using Titanium.Web.Proxy.Models;
......@@ -118,6 +119,11 @@ namespace Titanium.Web.Proxy.Http
return;
}
if (!HasBody)
{
throw new BodyNotFoundException("Response don't have a body.");
}
if (!IsBodyRead && throwWhenNotReadYet)
{
throw new Exception("Response body is not read yet. " +
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment