Skip to content

Commit

Permalink
fix(邮件通知): 优化获取邮件附件,过大时的抛错国际化 (#568)
Browse files Browse the repository at this point in the history
* fix(邮件通知): 优化获取邮件附件,过大时的抛错国际化

* fix(邮件通知): 优化使用通用的国际化信息

* fix(邮件通知): 代码优化

---------

Co-authored-by: fighter-wang <[email protected]>
  • Loading branch information
fighter-wang and fighter-wang authored Sep 3, 2024
1 parent 3ce520e commit bf7e19c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,14 @@ protected Mono<Void> doSend(ParsedEmailTemplate template) {

return Flux
.fromIterable(template.getAttachments().entrySet())
.flatMap(entry -> Mono.zip(Mono.just(entry.getKey()), convertResource(entry.getValue())))
.flatMap(entry -> Mono
.zip(Mono.just(entry.getKey()), convertResource(entry.getValue()))
.onErrorResume(err -> Mono
.error(() -> new BusinessException.NoStackTrace("error.load_attachment_failed",
500,
entry.getKey(),
err.getMessage())))
)
.flatMap(tp2 -> Mono
.fromCallable(() -> {
//添加附件
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error.load_attachment_failed=load attachment [{0}] failed:{1}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
error.load_attachment_failed=\u52A0\u8F7D\u9644\u4EF6[{0}]\u5931\u8D25\uFF1A{1}

0 comments on commit bf7e19c

Please sign in to comment.