Line data Source code
1 : #region Copyright
2 : // // -----------------------------------------------------------------------
3 : // // <copyright company="Chinchilla Software Limited">
4 : // // Copyright Chinchilla Software Limited. All rights reserved.
5 : // // </copyright>
6 : // // -----------------------------------------------------------------------
7 : #endregion
8 :
9 : using System;
10 : using Cqrs.Messages;
11 :
12 : namespace Cqrs.Exceptions
13 : {
14 : /// <summary>
15 : /// The <see cref="Exception"/> that is thrown when a given <see cref="IMessage"/> fails authorisation.
16 : /// </summary>
17 : [Serializable]
18 : public class UnAuthorisedMessageReceivedException : UnauthorizedAccessException
19 1 : {
20 : /// <summary>
21 : /// Instantiates a new instance of <see cref="UnAuthorisedMessageReceivedException"/>.
22 : /// </summary>
23 1 : public UnAuthorisedMessageReceivedException(string typeName, string id, object identifyMessage)
24 : : base(string.Format("A message arrived with the {0} was of type {1}{2} and was not authorized.", id, typeName, identifyMessage))
25 : {
26 : }
27 :
28 : /// <summary>
29 : /// Instantiates a new instance of <see cref="UnAuthorisedMessageReceivedException"/> with a specified error message.
30 : /// </summary>
31 : /// <param name="message">The message that describes the error.</param>
32 1 : public UnAuthorisedMessageReceivedException(string message)
33 : : base(message)
34 : {
35 : }
36 : }
37 : }
|