Share via


SKCheckedException Class

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • com.microsoft.semantickernel.exceptions.SKCheckedException

public class SKCheckedException
extends java.lang.Exception

Provides the base exception from which all CHECKED Semantic Kernel exceptions derive.

Constructor Summary

Modifier Constructor Description
protected SKCheckedException()

Initializes a new instance of the SKCheckedException class with a default message.

SKCheckedException(String message)

Initializes a new instance of the SKCheckedException class with its message set to message.

SKCheckedException(String message, Throwable cause)

Initializes a new instance of the SKCheckedException class with its message set to message.

SKCheckedException(Throwable cause)

Initializes a new instance of the SKCheckedException class with its message set to null and the cause set to e.

Method Summary

Modifier and Type Method and Description
static SKCheckedException build(String message, Exception cause)

Forms a checked exception, if the exception is already an SK exception, it will be unwrapped and the cause extracted.

protected static java.lang.String formatDefaultMessage(String errorMessage, String message)

Translate the error code into a default message format.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Methods inherited from java.lang.Throwable

java.lang.Throwable.addSuppressed java.lang.Throwable.fillInStackTrace java.lang.Throwable.getCause java.lang.Throwable.getLocalizedMessage java.lang.Throwable.getMessage java.lang.Throwable.getStackTrace java.lang.Throwable.getSuppressed java.lang.Throwable.initCause java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.printStackTrace java.lang.Throwable.setStackTrace java.lang.Throwable.toString

Constructor Details

SKCheckedException

protected SKCheckedException()

Initializes a new instance of the SKCheckedException class with a default message.

SKCheckedException

public SKCheckedException(String message)

Initializes a new instance of the SKCheckedException class with its message set to message.

Parameters:

message - A string that describes the error.

SKCheckedException

public SKCheckedException(String message, Throwable cause)

Initializes a new instance of the SKCheckedException class with its message set to message.

Parameters:

message - A string that describes the error.
cause - The exception that is the cause of the current exception.

SKCheckedException

public SKCheckedException(Throwable cause)

Initializes a new instance of the SKCheckedException class with its message set to null and the cause set to e.

Parameters:

cause - The exception that is the cause of the current exception.

Method Details

build

public static SKCheckedException build(String message, Exception cause)

Forms a checked exception, if the exception is already an SK exception, it will be unwrapped and the cause extracted.

Parameters:

message - The message to be displayed
cause - The exception that is the cause of the current exception.

Returns:

A checked exception

formatDefaultMessage

protected static String formatDefaultMessage(String errorMessage, String message)

Translate the error code into a default message format.

Parameters:

errorMessage - The error message from an error code
message - The message from the code which throws the exception

Returns:

A formatted message

Applies to