| 1 |
// AprSharp, a wrapper library around the Apache Portable Runtime Library |
|---|
| 2 |
#region Copyright (C) 2004 SOFTEC sa. |
|---|
| 3 |
// |
|---|
| 4 |
// This library is free software; you can redistribute it and/or |
|---|
| 5 |
// modify it under the terms of the GNU Lesser General Public |
|---|
| 6 |
// License as published by the Free Software Foundation; either |
|---|
| 7 |
// version 2.1 of the License, or (at your option) any later version. |
|---|
| 8 |
// |
|---|
| 9 |
// This library is distributed in the hope that it will be useful, |
|---|
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|---|
| 12 |
// Lesser General Public License for more details. |
|---|
| 13 |
// |
|---|
| 14 |
// You should have received a copy of the GNU Lesser General Public |
|---|
| 15 |
// License along with this library; if not, write to the Free Software |
|---|
| 16 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 |
// |
|---|
| 18 |
// Sources, support options and lastest version of the complete library |
|---|
| 19 |
// is available from: |
|---|
| 20 |
// http://www.softec.st/AprSharp |
|---|
| 21 |
// |
|---|
| 22 |
// |
|---|
| 23 |
// Initial authors : |
|---|
| 24 |
// Denis Gervalle |
|---|
| 25 |
// Olivier Desaive |
|---|
| 26 |
#endregion |
|---|
| 27 |
// |
|---|
| 28 |
using System; |
|---|
| 29 |
using System.Runtime.Serialization; |
|---|
| 30 |
|
|---|
| 31 |
namespace Softec.AprSharp |
|---|
| 32 |
{ |
|---|
| 33 |
[Serializable] |
|---|
| 34 |
public class AprException : Exception |
|---|
| 35 |
{ |
|---|
| 36 |
const int Result = unchecked ((int)0xA0400000); |
|---|
| 37 |
|
|---|
| 38 |
public AprException() |
|---|
| 39 |
: base ( "An unknown exception from Apr Library has occured." ) |
|---|
| 40 |
{ |
|---|
| 41 |
HResult = Result; |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
public AprException(string s) |
|---|
| 45 |
: base ( s ) |
|---|
| 46 |
{ |
|---|
| 47 |
HResult = Result; |
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
public AprException(string s, Exception innerException) |
|---|
| 51 |
: base ( s, innerException ) |
|---|
| 52 |
{ |
|---|
| 53 |
HResult = Result; |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
public AprException(int apr_status) |
|---|
| 57 |
: base ( Apr.StrError(apr_status) ) |
|---|
| 58 |
{ |
|---|
| 59 |
HResult = unchecked (Result + apr_status); |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|
| 62 |
public AprException(int apr_status, Exception innerException) |
|---|
| 63 |
: base ( Apr.StrError(apr_status), innerException ) |
|---|
| 64 |
{ |
|---|
| 65 |
HResult = unchecked (Result + apr_status); |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
public AprException(SerializationInfo info, StreamingContext context) |
|---|
| 69 |
: base (info, context) |
|---|
| 70 |
{ |
|---|
| 71 |
} |
|---|
| 72 |
} |
|---|
| 73 |
} |
|---|