GridFSException.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* Copyright 2015-present MongoDB Inc.
  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.
  14. */
  15. using System;
  16. #if NET452
  17. using System.Runtime.Serialization;
  18. #endif
  19. namespace MongoDB.Driver.GridFS
  20. {
  21. /// <summary>
  22. /// Represents a GridFS exception.
  23. /// </summary>
  24. #if NET452
  25. [Serializable]
  26. #endif
  27. public class GridFSException : MongoException
  28. {
  29. // constructors
  30. /// <summary>
  31. /// Initializes a new instance of the <see cref="GridFSException"/> class.
  32. /// </summary>
  33. /// <param name="message">The error message.</param>
  34. public GridFSException(string message)
  35. : base(message)
  36. {
  37. }
  38. /// <summary>
  39. /// Initializes a new instance of the <see cref="GridFSException"/> class.
  40. /// </summary>
  41. /// <param name="message">The error message.</param>
  42. /// <param name="innerException">The inner exception.</param>
  43. public GridFSException(string message, Exception innerException)
  44. : base(message, innerException)
  45. {
  46. }
  47. #if NET452
  48. /// <summary>
  49. /// Initializes a new instance of the <see cref="GridFSException"/> class.
  50. /// </summary>
  51. /// <param name="info">The SerializationInfo.</param>
  52. /// <param name="context">The StreamingContext.</param>
  53. public GridFSException(SerializationInfo info, StreamingContext context)
  54. : base(info, context)
  55. {
  56. }
  57. #endif
  58. }
  59. }