commit 8c3f5a7412381af0afde1b8dcff7c60577a2a2d7 parent 822f344cf44ac0990d76c35262c41dc90c8248ca Author: Dominik Schmidt <das1993@hotmail.com> Date: Wed, 9 Sep 2015 19:18:03 +0200 Differentiate HTTP-status 200, 304 and others. Diffstat:
drss/rss.d | | | 9 | +++++++-- |
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drss/rss.d b/drss/rss.d @@ -270,7 +270,12 @@ abstract class DRSS(T=Entry){ debug(RSS) writeln("Have news, parsing and returning xml"); return true; } - debug(RSS) writeln("Have no news, returning null"); - return false; + else if(http.statusLine.code==304){ + debug(RSS) writeln("Have no news, returning null"); + return false; + } + else{ + throw new Exception("Error in HTTP-Request: statuscode "~std.conv.to!string(http.statusLine.code)); + } } }