Browse Source

Merge branch 'dev' into cmskit-widget-render

pull/13082/head
malik masis 4 years ago
parent
commit
c0d8041e02
  1. 8
      docs/en/UI/Blazor/Error-Handling.md
  2. 12
      framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs

8
docs/en/UI/Blazor/Error-Handling.md

@ -23,12 +23,12 @@ There are different type of `Exception` classes handled differently by the ABP F
`UserFriendlyException` is a special type of exception. You can directly show a error message dialog to the user by throwing such an exception.
{{if UI == "BlazorServer"}}
> For Blazor Server, exceptions must be handled manually. Otherwise it crashes the whole application. Auto Exception Handling is not possible with Blazor Server right now, please follow [this issue](https://github.com/abpframework/abp/issues/8195) to see progress. In meantime, you can use try-catch blocks and call the `HandleErrorAsync` method of ABP to handle errors manually, which shows an error dialog for you.
**Example**
{{if UI == "BlazorServer"}}
````csharp
@page "/"
@using Volo.Abp
@ -55,6 +55,8 @@ There are different type of `Exception` classes handled differently by the ABP F
{{if UI == "Blazor"}}
**Example**
````csharp
@page "/"
@using Volo.Abp
@ -97,4 +99,4 @@ Errors (like Validation, Authorization and User Friendly Errors) sent by the ser
## See Also
* [Exception Handling System](../../Exception-Handling.md)
* [Exception Handling System](../../Exception-Handling.md)

12
framework/src/Volo.Abp.EventBus.Azure/Volo/Abp/EventBus/Azure/AzureDistributedEventBus.cs

@ -108,9 +108,17 @@ public class AzureDistributedEventBus : DistributedEventBusBase, ISingletonDepen
foreach (var outgoingEvent in outgoingEventArray)
{
if (!messageBatch.TryAddMessage(new ServiceBusMessage(outgoingEvent.EventData) { Subject = outgoingEvent.EventName }))
var message = new ServiceBusMessage(outgoingEvent.EventData) { Subject = outgoingEvent.EventName };
if (message.MessageId.IsNullOrWhiteSpace())
{
message.MessageId = outgoingEvent.Id.ToString();
}
if (!messageBatch.TryAddMessage(message))
{
throw new AbpException("The message is too large to fit in the batch. Set AbpEventBusBoxesOptions.OutboxWaitingEventMaxCount to reduce the number");
throw new AbpException(
"The message is too large to fit in the batch. Set AbpEventBusBoxesOptions.OutboxWaitingEventMaxCount to reduce the number");
}
}

Loading…
Cancel
Save