Class HttpException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- club.minnced.discord.webhook.exception.HttpException
-
- All Implemented Interfaces:
Serializable
public class HttpException extends RuntimeException
Exception thrown in case of unexpected non-2xx HTTP response.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HttpException(int code, @NotNull String body, @NotNull Headers headers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull String
getBody()
The body of HTTP responseint
getCode()
The HTTP status code@NotNull Headers
getHeaders()
The HTTP headers.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Method Detail
-
getCode
public int getCode()
The HTTP status code- Returns:
- The status code
-
getBody
@NotNull public @NotNull String getBody()
The body of HTTP response- Returns:
- The body
-
-