Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 147 for onFailure (0.07 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,
            )
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 3.2K bytes
    - Viewed (0)
  2. 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 void onFailure(Throwable t) {
                synchronized (monitor) {
                  assertFalse(called);
                  assertThat(t).isInstanceOf(CancellationException.class);
                  called = true;
                }
              }
    Registered: 2024-11-01 12:43
    - Last Modified: 2024-10-21 15:41
    - 6.6K 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()
            }
          },
        )
    
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 4.6K bytes
    - Viewed (0)
  4. 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,
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-04-01 10:07
    - 2.8K bytes
    - Viewed (0)
  5. 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;
    Registered: 2024-11-01 11:42
    - Last Modified: 2016-11-19 20:16
    - 2.4K bytes
    - Viewed (0)
  6. 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.
       */
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-23 14:31
    - 3.5K bytes
    - Viewed (0)
  7. 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))
        }
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 6.9K bytes
    - Viewed (0)
  8. okhttp/src/test/java/okhttp3/WholeOperationTimeoutTest.kt

        val exceptionRef = AtomicReference<Throwable>()
        val call = client.newCall(request)
        call.timeout().timeout(250, TimeUnit.MILLISECONDS)
        call.enqueue(
          object : Callback {
            override fun onFailure(
              call: Call,
              e: IOException,
            ) {
              exceptionRef.set(e)
              latch.countDown()
            }
    
            @Throws(IOException::class)
            override fun onResponse(
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 10.5K bytes
    - Viewed (0)
  9. 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) {
    Registered: 2024-11-01 11:42
    - Last Modified: 2024-01-08 01:13
    - 3.1K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/PrintEvents.java

        Request washingtonPostRequest = new Request.Builder()
            .url("https://www.washingtonpost.com/")
            .build();
        client.newCall(washingtonPostRequest).enqueue(new Callback() {
          @Override public void onFailure(Call call, IOException e) {
          }
    
          @Override public void onResponse(Call call, Response response) throws IOException {
            try (ResponseBody body = response.body()) {
    Registered: 2024-11-01 11:42
    - Last Modified: 2020-02-16 23:20
    - 6.1K bytes
    - Viewed (0)
Back to top