Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 124 for exceptions (0.22 sec)

  1. okhttp/src/main/kotlin/okhttp3/Interceptor.kt

     * includes both natural exceptions such as unreachable servers, as well as synthetic exceptions
     * when responses are of an unexpected type or cannot be decoded.
     *
     * Other exception types cancel the current call:
     *
     *  * For synchronous calls made with [Call.execute], the exception is propagated to the caller.
     *
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  2. docs/changelogs/changelog_4x.md

        scheduling. In your debugger you will see new thread names and more use of daemon threads.
    
     *  Fix: Don't drop callbacks on unexpected exceptions. When an interceptor throws an unchecked
        exception the callback is now notified that the call was canceled. The exception is still sent
        to the uncaught exception handler for reporting and recovery.
    
     *  Fix: Un-deprecate `MockResponse.setHeaders()` and other setters. These were deprecated in OkHttp
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Wed Apr 17 13:25:31 GMT 2024
    - 25.2K bytes
    - Viewed (0)
  3. okhttp/src/test/java/okhttp3/internal/ws/WebSocketWriterTest.kt

    class WebSocketWriterTest {
      private val data = Buffer()
      private val random = Random(0)
    
      /**
       * Check all data as verified inside of the test. We do this in an AfterEachCallback so that
       * exceptions thrown from the test do not cause this check to fail.
       */
      @RegisterExtension
      val noDataLeftBehind =
        AfterEachCallback { context: ExtensionContext ->
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.3K bytes
    - Viewed (0)
  4. okhttp-testing-support/src/main/kotlin/okhttp3/TestUtilJvm.kt

      @JvmStatic
      val windows: Boolean
        get() = System.getProperty("os.name", "?").startsWith("Windows")
    
      /**
       * Make assertions about the suppressed exceptions on this. Prefer this over making direct calls
       * so tests pass on GraalVM, where suppressed exceptions are silently discarded.
       *
       * https://github.com/oracle/graal/issues/3008
       */
      @JvmStatic
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 4.3K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/HttpUrlTest.kt

        assertInvalid("http://\uDBFF\uDFFF", "Invalid URL host: \"\uDBFF\uDFFF\"")
      }
    
      @Test
      fun hostnameUri() {
        // Host names are special:
        //
        //  * Several characters are forbidden and must throw exceptions if used.
        //  * They don't use percent escaping at all.
        //  * They use punycode for internationalization.
        //  * URI is much more strict than HttpUrl or URL on what's accepted.
        //
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 67.9K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/URLConnectionTest.kt

        assertFailsWith<UnsupportedOperationException> {
          client.newBuilder()
            .sslSocketFactory(handshakeCertificates.sslSocketFactory())
        }
      }
    
      /** Confirm that runtime exceptions thrown inside of OkHttp propagate to the caller.  */
      @Test
      fun unexpectedExceptionSync() {
        client =
          client.newBuilder()
            .dns { hostname: String? -> throw RuntimeException("boom!") }
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 131.7K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/EventListener.kt

     * multiple routes to be attempted simultaneously.
     *
     * Events and sequences of events may be repeated for retries and follow-ups.
     *
     * All event methods must execute fast, without external locking, cannot throw exceptions, attempt
     * to mutate the event parameters, or be re-entrant back into the client. Any IO - writing to files
     * or network should be done asynchronously.
     */
    abstract class EventListener {
      /**
    Plain Text
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15.2K bytes
    - Viewed (0)
  8. samples/guide/src/main/java/okhttp3/recipes/ConfigureTimeouts.java

      private final OkHttpClient client;
    
      public ConfigureTimeouts() throws Exception {
        client = new OkHttpClient.Builder()
            .connectTimeout(5, TimeUnit.SECONDS)
            .writeTimeout(5, TimeUnit.SECONDS)
            .readTimeout(5, TimeUnit.SECONDS)
            .callTimeout(10, TimeUnit.SECONDS)
            .build();
      }
    
      public void run() throws Exception {
        Request request = new Request.Builder()
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat Sep 28 18:00:26 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  9. samples/guide/src/main/java/okhttp3/recipes/PostFile.java

    public final class PostFile {
      public static final MediaType MEDIA_TYPE_MARKDOWN
          = MediaType.get("text/x-markdown; charset=utf-8");
    
      private final OkHttpClient client = new OkHttpClient();
    
      public void run() throws Exception {
        File file = new File("README.md");
    
        Request request = new Request.Builder()
            .url("https://api.github.com/markdown/raw")
            .post(RequestBody.create(file, MEDIA_TYPE_MARKDOWN))
            .build();
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Sat May 25 18:02:55 GMT 2019
    - 1.5K bytes
    - Viewed (0)
  10. samples/guide/src/main/java/okhttp3/recipes/HttpsServer.java

    import okhttp3.tls.HandshakeCertificates;
    import okhttp3.tls.HeldCertificate;
    
    /**
     * Create an HTTPS server with a self-signed certificate that OkHttp trusts.
     */
    public class HttpsServer {
      public void run() throws Exception {
        HeldCertificate localhostCertificate = new HeldCertificate.Builder()
            .addSubjectAlternativeName("localhost")
            .build();
    
        HandshakeCertificates serverCertificates = new HandshakeCertificates.Builder()
    Java
    - Registered: Fri Apr 26 11:42:10 GMT 2024
    - Last Modified: Mon Jan 02 14:04:37 GMT 2023
    - 2.1K bytes
    - Viewed (0)
Back to top