- Add exception handling around new interface CommandExceptionResolver which allows to define a chain of resolvers to process errors before exception is bubbled up to result handlers. - Will be foundation to add more sophisticated error handling features compared to what spring itself have for rest layer. - Resolver returns CommandHandlingResult holder which further can be used to make a choice what to print into console and if spesific exit code should be used in non-interactive mode. - Exception handling can be defined globally and per command giving a change for user to customise i.e. error thrown by parser. - CommandParserExceptionResolver replaces CommandParserExceptionsExceptionResultHandler and provides more meaninful message for missing options. - Fixes #503
93 lines
3.3 KiB
JSON
93 lines
3.3 KiB
JSON
{
|
|
"version": "0.2.0",
|
|
"configurations": [
|
|
{
|
|
"type": "java",
|
|
"name": "Sample interactive",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "Sample help",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "help"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "Sample fail noarg",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "fail"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "Sample fail arg",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "fail --elementType TYPE"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e reg error-handling",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg error-handling"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e reg error-handling arg1 throw1",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg error-handling --arg1 throw1"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e reg error-handling arg1 throw2",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg error-handling --arg1 throw2"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e reg error-handling arg1 throw3",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg error-handling --arg1 throw3"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e exit-code noarg",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg exit-code"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e exit-code arg hi",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg exit-code --arg1 hi"
|
|
},
|
|
{
|
|
"type": "java",
|
|
"name": "e2e exit-code arg fun",
|
|
"request": "launch",
|
|
"mainClass": "org.springframework.shell.samples.SpringShellSample",
|
|
"projectName": "spring-shell-samples",
|
|
"args": "e2e reg exit-code --arg1 fun"
|
|
}
|
|
]
|
|
}
|