Skip to content

Commit

Permalink
Merge pull request #21 from EasyAbp/improve-exception-handling
Browse files Browse the repository at this point in the history
Improve exception handling
  • Loading branch information
gdlcf88 authored Mar 19, 2023
2 parents c117d66 + c94e48c commit 536a97b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<AbpVersion>7.0.0</AbpVersion>
<EasyAbpPrivateMessagingModuleVersion>1.6.0</EasyAbpPrivateMessagingModuleVersion>
<EasyAbpAbpWeChatModuleVersion>2.3.4</EasyAbpAbpWeChatModuleVersion>
<EasyAbpAbpWeChatModuleVersion>2.3.5</EasyAbpAbpWeChatModuleVersion>

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.0.0-preview.1</Version>
<Version>2.0.0-preview.2</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using EasyAbp.NotificationService.NotificationInfos;
using EasyAbp.NotificationService.Notifications;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Emailing;
using Volo.Abp.Uow;

Expand Down Expand Up @@ -54,7 +55,8 @@ await EmailSender.SendAsync(userEmailAddress,
catch (Exception e)
{
Logger.LogException(e);
await SetNotificationResultAsync(notification, false, e.ToString());
var message = e is BusinessException b ? b.Code ?? b.Message : e.ToString();
await SetNotificationResultAsync(notification, false, message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using EasyAbp.NotificationService.NotificationInfos;
using EasyAbp.NotificationService.Notifications;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Json;
using Volo.Abp.Sms;
using Volo.Abp.Uow;
Expand Down Expand Up @@ -65,7 +66,8 @@ await SetNotificationResultAsync(notification, false,
catch (Exception e)
{
Logger.LogException(e);
await SetNotificationResultAsync(notification, false, e.ToString());
var message = e is BusinessException b ? b.Code ?? b.Message : e.ToString();
await SetNotificationResultAsync(notification, false, message);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using EasyAbp.NotificationService.Notifications;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Uow;

namespace EasyAbp.NotificationService.Provider.WeChatOfficial;
Expand Down Expand Up @@ -76,7 +77,8 @@ await SetNotificationResultAsync(notification, false,
catch (Exception e)
{
Logger.LogException(e);
await SetNotificationResultAsync(notification, false, e.ToString());
var message = e is BusinessException b ? b.Code ?? b.Message : e.ToString();
await SetNotificationResultAsync(notification, false, message);
}
}

Expand Down

0 comments on commit 536a97b

Please sign in to comment.