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

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

There is a newer version: 0.4.0
Show newest version
package com.launchableinc.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 - 2024 Weber Informatics LLC | Privacy Policy