Class TransportResult


  • public abstract class TransportResult
    extends java.lang.Object
    A result of ITransport.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 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()