seqeralabs / wave-cli

Command line tool for Wave containers provisioning service
https://seqera.io/wave
Apache License 2.0
13 stars 3 forks source link

Better handle http retry events #65

Closed pditommaso closed 7 months ago

pditommaso commented 7 months ago

When http request are retried a concise warning message should be displayed without reporting the full stack trace

16:32:13.384 [main] WARN  dev.langchain4j.internal.RetryUtils - Exception was thrown on attempt 1 of 3
dev.ai4j.openai4j.OpenAiHttpException: {
    "error": {
        "message": "You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.",
        "type": "insufficient_quota",
        "param": null,
        "code": "insufficient_quota"
    }
}

    at dev.ai4j.openai4j.Utils.toException(Utils.java:8)
    at dev.ai4j.openai4j.SyncRequestExecutor.execute(SyncRequestExecutor.java:28)
    at dev.ai4j.openai4j.RequestExecutor.execute(RequestExecutor.java:59)
    at dev.langchain4j.model.openai.OpenAiChatModel.lambda$generate$1(OpenAiChatModel.java:153)
    at dev.langchain4j.internal.RetryUtils$RetryPolicy.withRetry(RetryUtils.java:192)
    at dev.langchain4j.internal.RetryUtils.withRetry(RetryUtils.java:229)
    at dev.langchain4j.model.openai.OpenAiChatModel.generate(OpenAiChatModel.java:153)
    at dev.langchain4j.model.openai.OpenAiChatModel.generate(OpenAiChatModel.java:123)
    at io.seqera.wave.cli.util.GptHelper.grabPackages(GptHelper.java:78)
    at io.seqera.wave.cli.App.packagesSpec(App.java:642)
    at io.seqera.wave.cli.App.createRequest(App.java:409)
    at io.seqera.wave.cli.App.run(App.java:448)
    at io.seqera.wave.cli.App.main(App.java:246)
    at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
pditommaso commented 7 months ago

Solved by b2cfdd3f