Claus Ibsen created CAMEL-21615:
-----------------------------------

             Summary: camel-jbang - Nicer error when export without name or gav
                 Key: CAMEL-21615
                 URL: https://issues.apache.org/jira/browse/CAMEL-21615
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.10.0


Avoid this ugly stacktrace, but just report a nice one line error

~/workspace/deleteme/xxy ❯ camel export --dir=code --runtime=camel-main
org.apache.camel.RuntimeCamelException: Failed to resolve project name - please 
provide --name, --gav or source file
    at 
org.apache.camel.dsl.jbang.core.commands.Export.getProjectName(Export.java:180)
    at org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:61)
    at 
org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:260)
    at 
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
    at 
org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:37)
    at picocli.CommandLine.executeUserObject(CommandLine.java:2045)
    at picocli.CommandLine.access$1500(CommandLine.java:148)
    at 
picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
    at picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
    at 
picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
    at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
    at picocli.CommandLine.execute(CommandLine.java:2174)
    at 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:175)
    at 
org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:62)
    at main.CamelJBang.main(CamelJBang.java:36)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to