Skip to content

Commit

Permalink
Add RequestMessageException.
Browse files Browse the repository at this point in the history
  • Loading branch information
veblush committed May 29, 2016
1 parent 40cedd4 commit b61e19f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
15 changes: 15 additions & 0 deletions core/Akka.Interfaced-Base/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@ protected AkkaInterfacedException(string message, Exception innerException = nul
}
}

/// <summary>
/// This exception is thrown when a request message has something wrong.
/// </summary>
public class RequestMessageException : AkkaInterfacedException
{
public RequestMessageException()
{
}

public RequestMessageException(string message, Exception innerException = null)
: base(message, innerException)
{
}
}

/// <summary>
/// This exception is thrown when the actor which have a request is not found.
/// </summary>
Expand Down
4 changes: 2 additions & 2 deletions core/Akka.Interfaced/InterfacedActor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private void OnRequestMessage(RequestMessage request)
sender.Tell(new ResponseMessage
{
RequestId = request.RequestId,
Exception = new InvalidMessageException("Empty payload")
Exception = new RequestMessageException("Empty payload")
});
return;
}
Expand All @@ -216,7 +216,7 @@ private void OnRequestMessage(RequestMessage request)
sender.Tell(new ResponseMessage
{
RequestId = request.RequestId,
Exception = new InvalidMessageException("Cannot find handler")
Exception = new RequestMessageException("Cannot find handler")
});
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ private void OnRequestMessage(RequestMessage request)
sender.Tell(new ResponseMessage
{
RequestId = request.RequestId,
Exception = new InvalidMessageException("Empty payload")
Exception = new RequestMessageException("Empty payload")
});
return;
}
Expand All @@ -231,7 +231,7 @@ private void OnRequestMessage(RequestMessage request)
sender.Tell(new ResponseMessage
{
RequestId = request.RequestId,
Exception = new InvalidMessageException("Cannot find handler")
Exception = new RequestMessageException("Cannot find handler")
});
return;
}
Expand Down

0 comments on commit b61e19f

Please sign in to comment.