forked from halo-dev/halo
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add localized exception information for plugin install and …
…upgrade
- Loading branch information
Showing
4 changed files
with
36 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/run/halo/app/infra/exception/UnsatisfiedAttributeValueException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package run.halo.app.infra.exception; | ||
|
||
import jakarta.validation.constraints.Null; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.web.server.ServerWebInputException; | ||
|
||
/** | ||
* {@link ServerWebInputException} subclass that indicates an unsatisfied | ||
* attribute value in request parameters. | ||
* | ||
* @author guqing | ||
* @since 2.2.0 | ||
*/ | ||
public class UnsatisfiedAttributeValueException extends ServerWebInputException { | ||
|
||
public UnsatisfiedAttributeValueException(String reason, @Nullable String messageDetailCode, | ||
@Null Object[] messageDetailArguments) { | ||
super(reason, null, null, messageDetailCode, messageDetailArguments); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
problemDetail.title.org.springframework.web.server.ServerWebInputException=请求参数有误 | ||
problemDetail.title.run.halo.app.infra.exception.AttachmentAlreadyExistsException=附件已存在 | ||
problemDetail.title.org.springframework.web.server.ServerWebInputException=\u8BF7\u6C42\u53C2\u6570\u6709\u8BEF | ||
problemDetail.title.run.halo.app.infra.exception.UnsatisfiedAttributeValueException=\u8BF7\u6C42\u53C2\u6570\u5C5E\u6027\u503C\u4E0D\u6EE1\u8DB3\u8981\u6C42 | ||
problemDetail.title.run.halo.app.infra.exception.AttachmentAlreadyExistsException=\u9644\u4EF6\u5DF2\u5B58\u5728 | ||
|
||
problemDetail.run.halo.app.infra.exception.AttachmentAlreadyExistsException=文件 {0} 已存在,建议更名后重试。 | ||
problemDetail.run.halo.app.infra.exception.AttachmentAlreadyExistsException=\u6587\u4EF6 {0} \u5DF2\u5B58\u5728\uFF0C\u5EFA\u8BAE\u66F4\u540D\u540E\u91CD\u8BD5\u3002 | ||
|
||
problemDetail.plugin.version.unsatisfied.requires=\u63D2\u4EF6\u8981\u6C42\u4E00\u4E2A\u6700\u5C0F\u7684\u7CFB\u7EDF\u7248\u672C\u4E3A {0}, \u4F46\u5F53\u524D\u7248\u672C\u4E3A {1}\u3002 |