-
Notifications
You must be signed in to change notification settings - Fork 394
Open
Labels
status/need-triageTeam needs to triage and take a first lookTeam needs to triage and take a first look
Description
In Spring Shell 3.4, I was using APIs such as CommandExceptionResolver to customise the way to handle exceptions. For example:
@Component
public class ArconiaCliExceptionResolver implements CommandExceptionResolver {
@Override
public CommandHandlingResult resolve(Exception ex) {
if (ex instanceof ArconiaCliException arconiaCliException) {
arconiaCliException.getTerminal().handleException(ex.getMessage(), ex);
return CommandHandlingResult.empty();
}
var attributedStringBuilder = new AttributedStringBuilder();
attributedStringBuilder.append(new AttributedString(ex.getMessage(), AttributedStyle.DEFAULT.foreground(AttributedStyle.RED)));
attributedStringBuilder.append("\n");
var attributedString = attributedStringBuilder.toAttributedString().toAnsi();
return CommandHandlingResult.of(attributedString);
}
} In Spring Shell 4.0, the CommandExceptionResolver and related APIs have been removed. What is the replacement for customising exception handling? It would be great to include this breaking change in the v4 migration guide, including some hints on how to migrate existing exception handling logic in Spring Shell 3.4.
Metadata
Metadata
Assignees
Labels
status/need-triageTeam needs to triage and take a first lookTeam needs to triage and take a first look