Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change CouchException to include the request URI

This way it will be easier to debug exceptions when they happen in production servers.
  • Loading branch information...
commit b8b36698ebad81e79602a263407b1aaee0fef58e 1 parent b973418
@ido-ran ido-ran authored
Showing with 9 additions and 2 deletions.
  1. +9 −2 LoveSeat/CouchException.cs
View
11 LoveSeat/CouchException.cs
@@ -8,18 +8,25 @@ public class CouchException : System.Exception
private readonly HttpWebRequest request;
private readonly HttpWebResponse response;
- public CouchException(HttpWebRequest request, HttpWebResponse response, string mesg) : base(mesg)
+ public CouchException(HttpWebRequest request, HttpWebResponse response, string mesg)
+ : base(BuildExceptionMessage(mesg, request))
{
this.request = request;
this.response = response;
}
public CouchException(HttpWebRequest request, CouchResponse response, string mesg)
- : base(mesg)
+ : base(BuildExceptionMessage(mesg, request))
{
}
public HttpWebRequest Request { get { return request; } }
public HttpWebResponse Response { get { return response; } }
+
+ private static string BuildExceptionMessage(string msg, HttpWebRequest request)
+ {
+ string excpetionMsg = string.Format("{0} {1}", request.RequestUri, msg);
+ return excpetionMsg;
+ }
}
}

0 comments on commit b8b3669

Please sign in to comment.
Something went wrong with that request. Please try again.