@ -7,13 +7,19 @@ namespace NzbDrone.Common.Http
public HttpRequest Request { get ; private set ; }
public HttpRequest Request { get ; private set ; }
public HttpResponse Response { get ; private set ; }
public HttpResponse Response { get ; private set ; }
public HttpException ( HttpRequest request , HttpResponse response )
public HttpException ( HttpRequest request , HttpResponse response , string message )
: base ( string . Format ( "HTTP request failed: [{0}:{1}] [{2}] at [{3}]" , ( int ) response . StatusCode , response . StatusCode , request . Method , request . Url ) )
: base ( message )
{
{
Request = request ;
Request = request ;
Response = response ;
Response = response ;
}
}
public HttpException ( HttpRequest request , HttpResponse response )
: this ( request , response , string . Format ( "HTTP request failed: [{0}:{1}] [{2}] at [{3}]" , ( int ) response . StatusCode , response . StatusCode , request . Method , request . Url ) )
{
}
public HttpException ( HttpResponse response )
public HttpException ( HttpResponse response )
: this ( response . Request , response )
: this ( response . Request , response )
{
{
@ -30,4 +36,4 @@ namespace NzbDrone.Common.Http
return base . ToString ( ) ;
return base . ToString ( ) ;
}
}
}
}
}
}