Package com.marcnuri.yakc.api
Class KubernetesException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.io.IOException
-
- com.marcnuri.yakc.api.KubernetesException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ClientErrorException,WatchException
public class KubernetesException extends java.io.IOExceptionSignals that an exception of some sort has occurred while performing some cluster action. This class is the general class of exceptions produced by failed or interrupted k8s cluster operations.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description KubernetesException(java.lang.String message, okhttp3.Response rawResponse)Constructs aKubernetesExceptionwith the specified detail message and OkHttpResponse.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static KubernetesExceptionforResponse(java.lang.String message, okhttp3.Response rawResponse)Factory method to createKubernetesExceptionbased on theResponseproduced by the server.intgetCode()Returns the HTTP status code that caused this exception.
-
-
-
Constructor Detail
-
KubernetesException
public KubernetesException(java.lang.String message, okhttp3.Response rawResponse)Constructs aKubernetesExceptionwith the specified detail message and OkHttpResponse.- Parameters:
message- The detail message.rawResponse- The OkHttp that caused this exception.
-
-
Method Detail
-
getCode
public int getCode()
Returns the HTTP status code that caused this exception.- Returns:
- the HTTP status code.
-
forResponse
public static KubernetesException forResponse(java.lang.String message, okhttp3.Response rawResponse)
Factory method to createKubernetesExceptionbased on theResponseproduced by the server.Depending on the response code it will return a specific
KubernetesExceptionimplementation applicable for that code. In case no specificKubernetesExceptionis found a generic one will be returned.- Parameters:
message- The detail message for theKubernetesException.rawResponse- TheResponsefrom which to compute the applicableKubernetesException.- Returns:
- the applicable
KubernetesExceptioninstance.
-
-