+2004-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * TraceHandler.cs: error code is 403 and the message different when
+ trace is enabled but not for remote clients.
+
2004-07-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* TraceHandler.cs: check that trace is enabled or throw.
#endif
class TraceNotAvailableException : HttpException
{
- public TraceNotAvailableException () :
- base ("Trace Error") {}
+ bool notLocal;
+
+ public TraceNotAvailableException (bool notLocal) :
+ base (notLocal ? 403 : 500, "Trace Error")
+ {
+ this.notLocal = notLocal;
+ }
internal override string Description {
- get { return "Trace.axd is not enabled in the configuration file for this application."; }
+ get {
+ if (notLocal)
+ return "Trace is not enabled for remote clients.";
+
+ return "Trace.axd is not enabled in the configuration file for this application.";
+ }
}
}
{
TraceManager manager = HttpRuntime.TraceManager;
- if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal) {
- throw new TraceNotAvailableException ();
- }
+ if (!manager.Enabled || manager.LocalOnly && !context.Request.IsLocal)
+ throw new TraceNotAvailableException (manager.Enabled);
HtmlTextWriter output = new HtmlTextWriter (context.Response.Output);