Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 146 for onFailure (0.18 sec)

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

      }
    
      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,
            )
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.2K bytes
    - Viewed (0)
  2. okhttp/src/test/java/okhttp3/internal/ws/WebSocketRecorder.kt

          events.add(Closed(code, reason))
        }
      }
    
      override fun onFailure(
        webSocket: WebSocket,
        t: Throwable,
        response: Response?,
      ) {
        Platform.get().log("[WS $name] onFailure", Platform.INFO, t)
        val delegate = delegate
        if (delegate != null) {
          this.delegate = null
          delegate.onFailure(webSocket, t, response)
        } else {
          events.add(Failure(t, response))
        }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.9K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/AutobahnTester.kt

              webSocket: WebSocket,
              code: Int,
              reason: String,
            ) {
              webSocket.close(1000, null)
              latch.countDown()
            }
    
            override fun onFailure(
              webSocket: WebSocket,
              t: Throwable,
              response: Response?,
            ) {
              t.printStackTrace(System.out)
              latch.countDown()
            }
          },
        )
    
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.6K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

              @Override
              public void onSuccess(String result) {
                fail("Was not expecting onSuccess() to be called.");
              }
    
              @Override
              public synchronized void onFailure(Throwable t) {
                assertFalse(called);
                assertThat(t).isInstanceOf(CancellationException.class);
                called = true;
              }
            };
        addCallback(f, callback, directExecutor());
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 06 12:56:11 GMT 2023
    - 6.3K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

              @Override
              public void onSuccess(String result) {
                fail("Was not expecting onSuccess() to be called.");
              }
    
              @Override
              public synchronized void onFailure(Throwable t) {
                assertFalse(called);
                assertThat(t).isInstanceOf(CancellationException.class);
                called = true;
              }
            };
        addCallback(f, callback, directExecutor());
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Tue Nov 15 16:33:21 GMT 2022
    - 6.3K bytes
    - Viewed (0)
  6. okhttp-android/src/main/kotlin/okhttp3/android/AndroidAsyncDns.kt

                callback.onFailure(
                  hostname,
                  UnknownHostException(e.message).apply {
                    initCause(e)
                  },
                )
              }
            },
          )
        } catch (e: Exception) {
          // Handle any errors that might leak out
          // https://issuetracker.google.com/issues/319957694
          callback.onFailure(
            hostname,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Apr 01 10:07:48 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  7. samples/slack/src/main/java/okhttp3/slack/RtmSession.java

        webSocket.close(1000, null);
        System.out.println("onClose (" + code + "): " + reason);
      }
    
      @Override public void onFailure(WebSocket webSocket, Throwable t, Response response) {
        // TODO(jwilson): can I read the response body? Do I have to?
        System.out.println("onFailure " + response);
      }
    
      @Override public void close() throws IOException {
        if (webSocket == null) return;
    
        WebSocket webSocket;
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Nov 19 20:16:58 GMT 2016
    - 2.4K bytes
    - Viewed (0)
  8. okhttp-coroutines/src/main/kotlin/okhttp3/coroutines/ExecuteAsync.kt

    suspend fun Call.executeAsync(): Response =
      suspendCancellableCoroutine { continuation ->
        continuation.invokeOnCancellation {
          this.cancel()
        }
        this.enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              continuation.resumeWithException(e)
            }
    
            override fun onResponse(
              call: Call,
              response: Response,
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 18 01:24:38 GMT 2024
    - 1.5K bytes
    - Viewed (0)
  9. okhttp/src/main/kotlin/okhttp3/AsyncDns.kt

         */
        fun onResponse(
          hostname: String,
          addresses: List<InetAddress>,
        )
    
        /**
         * Returns an error for the DNS query.
         */
        fun onFailure(
          hostname: String,
          e: IOException,
        )
      }
    
      /**
       * Class of DNS addresses, such that clients that treat these differently, such
       * as attempting IPv6 first, can make such decisions.
       */
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Tue Jan 23 14:31:42 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  10. 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))
        drainCancelQueue(eventSource)
      }
    
      private fun drainCancelQueue(eventSource: EventSource) {
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.1K bytes
    - Viewed (0)
Back to top