Package io.sentry.transport
Class TransportResult
- java.lang.Object
-
- io.sentry.transport.TransportResult
-
public abstract class TransportResult extends java.lang.Object
A result ofITransport.send(io.sentry.SentryEnvelope)
. Note that this class is intentionally not subclassable and has only two factory methods to capture the 2 possible states - success or error.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static @NotNull TransportResult
error()
Use this method to announce failure of sending the event.static @NotNull TransportResult
error(int responseCode)
Use this method to announce failure of sending the event.abstract int
getResponseCode()
abstract boolean
isSuccess()
static @NotNull TransportResult
success()
Use this method to announce success of sending the event.
-
-
-
Method Detail
-
success
@NotNull public static @NotNull TransportResult success()
Use this method to announce success of sending the event.- Returns:
- a successful transport result
-
error
@NotNull public static @NotNull TransportResult error(int responseCode)
Use this method to announce failure of sending the event.- Parameters:
responseCode
- the HTTP status code if known, -1 otherwise- Returns:
- an erroneous transport result
-
error
@NotNull public static @NotNull TransportResult error()
Use this method to announce failure of sending the event. Defaults responseCode to -1 (unknown responseCode)- Returns:
- an erroneous transport result
-
isSuccess
public abstract boolean isSuccess()
-
getResponseCode
public abstract int getResponseCode()
-
-