All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.theokanning.openai.OpenAiHttpException Maven / Gradle / Ivy

There is a newer version: 0.18.2
Show newest version
package com.theokanning.openai;

public class OpenAiHttpException extends RuntimeException {

    /**
     * HTTP status code
     */
    public final int statusCode;

    /**
     * OpenAI error code, for example "invalid_api_key"
     */
    public final String code;


    public final String param;

    /**
     * OpenAI error type, for example "invalid_request_error"
     * https://platform.openai.com/docs/guides/error-codes/python-library-error-types
     */
    public final String type;

    public OpenAiHttpException(OpenAiError error, Exception parent, int statusCode) {
        super(error.error.message, parent);
        this.statusCode = statusCode;
        this.code = error.error.code;
        this.param = error.error.param;
        this.type = error.error.type;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy