Skip to content
Browse files

Handle Errors properly in MessageHandler

  • Loading branch information...
1 parent 6db410f commit 300572c4e464c87050fda5ac049938a4141ffd00 @mythz mythz committed Nov 10, 2011
View
4 src/ServiceStack.Common/Messaging/MessageHandler.cs
@@ -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
View
2 src/ServiceStack.ServiceInterface/ServiceBase.cs
@@ -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());
}
}

0 comments on commit 300572c

Please sign in to comment.
Something went wrong with that request. Please try again.