Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for OnFailure (0.09 sec)

  1. okhttp-sse/src/main/kotlin/okhttp3/sse/internal/RealEventSource.kt

      }
    
      internal fun processResponse(response: Response) {
        response.use {
          if (!response.isSuccessful) {
            listener.onFailure(this, null, response)
            return
          }
    
          val body = response.body
    
          if (!body.isEventStream()) {
            listener.onFailure(
              this,
              IllegalStateException("Invalid content-type: ${body.contentType()}"),
              response,
            )
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 3.3K bytes
    - Viewed (0)
  2. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceRecorder.kt

        get().log("[ES] onClosed", Platform.INFO, null)
        events.add(Closed)
        drainCancelQueue(eventSource)
      }
    
      override fun onFailure(
        eventSource: EventSource,
        t: Throwable?,
        response: Response?,
      ) {
        get().log("[ES] onFailure", Platform.INFO, t)
        events.add(Failure(t, response, t?.message ?: response?.body?.string()))
        drainCancelQueue(eventSource)
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:32:52 UTC 2025
    - 3.2K bytes
    - Viewed (0)
  3. okhttp-sse/api/okhttp-sse.api

    	public fun <init> ()V
    	public fun onClosed (Lokhttp3/sse/EventSource;)V
    	public fun onEvent (Lokhttp3/sse/EventSource;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    	public fun onFailure (Lokhttp3/sse/EventSource;Ljava/lang/Throwable;Lokhttp3/Response;)V
    	public fun onOpen (Lokhttp3/sse/EventSource;Lokhttp3/Response;)V
    }
    
    public final class okhttp3/sse/EventSources {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 1.9K bytes
    - Viewed (0)
  4. okhttp-sse/src/main/kotlin/okhttp3/sse/EventSourceListener.kt

      /**
       * Invoked when an event source has been closed due to an error reading from or writing to the
       * network. Incoming events may have been lost. No further calls to this listener will be made.
       */
      open fun onFailure(
        eventSource: EventSource,
        t: Throwable?,
        response: Response?,
      ) {
      }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  5. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/connection/RealCall.kt

              } else {
                responseCallback.onFailure(this@RealCall, e)
              }
            } catch (t: Throwable) {
              cancel()
              if (!signalledCallback) {
                val canceledException = IOException("canceled due to $t")
                canceledException.initCause(t)
                responseCallback.onFailure(this@RealCall, canceledException)
              }
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  6. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceFactoryTest.java

          }
    
          @Override
          public void onClosed(@NotNull EventSource eventSource) {
            future.completeExceptionally(new IllegalStateException("closed"));
          }
    
          @Override
          public void onFailure(@NotNull EventSource eventSource, @Nullable Throwable t, @Nullable Response response) {
            future.completeExceptionally(t == null ? new NullPointerException() : t);
          }
        });
        future.get();
      }
    
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:47:47 UTC 2025
    - 2.8K bytes
    - Viewed (0)
  7. android-test-app/src/main/kotlin/okhttp/android/testapp/MainActivity.kt

        val url = "https://github.com/square/okhttp".toHttpUrl()
        println(url.topPrivateDomain())
    
        client.newCall(Request(url)).enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              println("failed: $e")
            }
    
            override fun onResponse(
              call: Call,
              response: Response,
            ) {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Tue Aug 19 08:10:39 UTC 2025
    - 1.7K bytes
    - Viewed (0)
  8. okhttp/src/jvmTest/kotlin/okhttp3/internal/http/ThreadInterruptTest.kt

        val call =
          client.newCall(
            Request
              .Builder()
              .url(server.url("/"))
              .build(),
          )
        call.enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: okio.IOException,
            ) {
              callFailure.complete(e)
            }
    
            override fun onResponse(
              call: Call,
              response: Response,
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Sat Aug 30 11:30:11 UTC 2025
    - 6.1K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/util/concurrent/FluentFutureTest.java

        f.addCallback(
            new FutureCallback<String>() {
              @Override
              public void onSuccess(String result) {
                called[0] = true;
              }
    
              @Override
              public void onFailure(Throwable t) {}
            },
            directExecutor());
        assertThat(called[0]).isTrue();
      }
    
      // Avoid trouble with automatic mapping between JRE and Kotlin runtime classes.
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Futures.java

            if (failure != null) {
              callback.onFailure(failure);
              return;
            }
          }
          V value;
          try {
            value = getDone(future);
          } catch (ExecutionException e) {
            callback.onFailure(e.getCause());
            return;
          } catch (Throwable e) {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 64.3K bytes
    - Viewed (0)
Back to top