More working tests.
[castle.git] / MonoRail / Castle.MonoRail.Framework / MonoRailException.cs
blob78b2fcfbccfa5d3472c700a564b621b56d1a41ed
1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Framework
17 using System;
18 using System.Runtime.Serialization;
20 /// <summary>
21 /// Base exception for monorail exceptions
22 /// </summary>
23 [Serializable]
24 public class MonoRailException : ApplicationException
26 private int? httpStatusCode;
27 private string httpStatusDesc;
29 /// <summary>
30 /// Initializes a new instance of the <see cref="MonoRailException"/> class.
31 /// </summary>
32 /// <param name="message">The message.</param>
33 public MonoRailException(string message) : base(message)
37 /// <summary>
38 /// Initializes a new instance of the <see cref="MonoRailException"/> class.
39 /// </summary>
40 /// <param name="httpStatusCode">The HTTP status code.</param>
41 /// <param name="httpStatusDesc">The HTTP status desc.</param>
42 /// <param name="message">The message.</param>
43 public MonoRailException(int httpStatusCode, string httpStatusDesc, string message)
44 : base(message)
46 this.httpStatusCode = httpStatusCode;
47 this.httpStatusDesc = httpStatusDesc;
50 /// <summary>
51 /// Initializes a new instance of the <see cref="MonoRailException"/> class.
52 /// </summary>
53 /// <param name="message">The message.</param>
54 /// <param name="args">The args.</param>
55 public MonoRailException(String message, params object[] args) : this(String.Format(message, args))
59 /// <summary>
60 /// Initializes a new instance of the <see cref="MonoRailException"/> class.
61 /// </summary>
62 /// <param name="message">The message.</param>
63 /// <param name="innerException">The inner exception.</param>
64 public MonoRailException(String message, Exception innerException) : base(message, innerException)
68 /// <summary>
69 /// Initializes a new instance of the <see cref="MonoRailException"/> class.
70 /// </summary>
71 /// <param name="info">The object that holds the serialized object data.</param>
72 /// <param name="context">The contextual information about the source or destination.</param>
73 public MonoRailException(SerializationInfo info, StreamingContext context) : base(info, context)
77 /// <summary>
78 /// Gets the HTTP status code.
79 /// </summary>
80 /// <value>The HTTP status code.</value>
81 public int? HttpStatusCode
83 get { return httpStatusCode; }
86 /// <summary>
87 /// Gets the HTTP status description.
88 /// </summary>
89 /// <value>The HTTP status description.</value>
90 public string HttpStatusDesc
92 get { return httpStatusDesc; }