Share via


SKException Class

  • java.lang.Object
    • java.lang.Throwable
      • java.lang.Exception
        • java.lang.RuntimeException
          • com.microsoft.semantickernel.exceptions.SKException

public class SKException
extends java.lang.RuntimeException

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

Constructor Summary

Modifier Constructor Description
protected SKException()

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

SKException(String message)

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

SKException(String message, Throwable cause)

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

SKException(Throwable cause)

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

Method Summary

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

Forms an unchecked 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

SKException

protected SKException()

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

SKException

public SKException(String message)

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

Parameters:

message - A string that describes the error.

SKException

public SKException(String message, Throwable cause)

Initializes a new instance of the SKException 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.

SKException

public SKException(Throwable cause)

Initializes a new instance of the SKException 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 SKException build(String message, Exception cause)

Forms an unchecked 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:

An unchecked 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