Browse Source

Handled uncaught exception in command handling

pull/529/head
Robert Raboud 7 years ago
parent
commit
047e3a945a
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs

+ 10
- 5
src/Services/Ordering/Ordering.API/Application/Commands/IdentifiedCommandHandler.cs View File

@ -48,11 +48,16 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.Commands
else
{
await _requestManager.CreateRequestForCommandAsync<T>(message.Id);
// Send the embeded business command to mediator so it runs its related CommandHandler
var result = await _mediator.Send(message.Command);
return result;
try
{
// Send the embeded business command to mediator so it runs its related CommandHandler
var result = await _mediator.Send(message.Command);
return result;
}
catch
{
return default(R);
}
}
}
}

Loading…
Cancel
Save