Skip to content

Commit

Permalink
Handle Errors properly in MessageHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
mythz committed Nov 11, 2011
1 parent 6db410f commit 300572c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ServiceStack.Common/Messaging/MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ public void ProcessMessage(IMessageQueueClient mqClient, Message<T> message)
try
{
var response = processMessageFn(message);
var responseEx = response as Exception;
if (responseEx != null)
throw responseEx;

this.TotalMessagesProcessed++;

//If there's no response publish the request message to its OutQ
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceStack.ServiceInterface/ServiceBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ protected HttpResult View(string viewName, object response)
/// <param name="request"></param>
public virtual object Execute(IMessage<TRequest> request)
{
return Run(request.GetBody());
return Execute(request.GetBody());
}
}

Expand Down

0 comments on commit 300572c

Please sign in to comment.