Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 172 for catch (0.14 sec)

  1. okhttp-tls/src/test/java/okhttp3/tls/HeldCertificateTest.kt

          |
          """.trimMargin()
        try {
          decode(certificatePem)
          fail<Any>()
        } catch (expected: IllegalArgumentException) {
          assertThat(expected.message).isEqualTo("string does not include a private key")
        }
        try {
          decode(pkcs8Pem)
          fail<Any>()
        } catch (expected: IllegalArgumentException) {
          assertThat(expected.message).isEqualTo("string does not include a certificate")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 22.5K bytes
    - Viewed (0)
  2. samples/unixdomainsockets/src/main/java/okhttp3/unixdomainsockets/UnixDomainSocketFactory.java

      }
    
      @Override public Socket createSocket(String host, int port) throws IOException {
        Socket result = createSocket();
    
        try {
          result.connect(new InetSocketAddress(host, port));
        } catch (IOException e) {
          result.close();
          throw e;
        }
        return result;
      }
    
      @Override public Socket createSocket(
          String host, int port, InetAddress localHost, int localPort) throws IOException {
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sun Dec 03 21:33:52 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Certificate.kt

          return certificates.single() as X509Certificate
        } catch (e: NoSuchElementException) {
          throw IllegalArgumentException("failed to decode certificate", e)
        } catch (e: IllegalArgumentException) {
          throw IllegalArgumentException("failed to decode certificate", e)
        } catch (e: GeneralSecurityException) {
          throw IllegalArgumentException("failed to decode certificate", e)
        }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  4. okhttp/src/main/kotlin/okhttp3/internal/platform/Platform.kt

          val context = readFieldOrNull(sslSocketFactory, sslContextClass, "context") ?: return null
          readFieldOrNull(context, X509TrustManager::class.java, "trustManager")
        } catch (e: ClassNotFoundException) {
          null
        } catch (e: RuntimeException) {
          // Throws InaccessibleObjectException (added in JDK9) on JDK 17 due to
          // JEP 403 Strongly Encapsulate JDK Internals.
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 9.8K bytes
    - Viewed (1)
  5. okhttp-java-net-cookiejar/src/main/kotlin/okhttp3/java/net/cookiejar/JavaNetCookieJar.kt

        for (cookie in cookies) {
          cookieStrings.add(cookieToString(cookie, true))
        }
        val multimap = mapOf("Set-Cookie" to cookieStrings)
        try {
          cookieHandler.put(url.toUri(), multimap)
        } catch (e: IOException) {
          Platform.get().log("Saving cookies failed for " + url.resolve("/...")!!, WARN, e)
        }
      }
    
      override fun loadForRequest(url: HttpUrl): List<Cookie> {
        val cookieHeaders =
          try {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:10:43 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  6. samples/static-server/src/main/java/okhttp3/sample/SampleServer.java

              ? directoryToResponse(path, file)
              : fileToResponse(path, file);
        } catch (FileNotFoundException e) {
          return new MockResponse()
              .setStatus("HTTP/1.1 404")
              .addHeader("content-type: text/plain; charset=utf-8")
              .setBody("NOT FOUND: " + path);
        } catch (IOException e) {
          return new MockResponse()
              .setStatus("HTTP/1.1 500")
    Java
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Jan 02 02:50:44 GMT 2019
    - 4.7K bytes
    - Viewed (0)
  7. okhttp/src/main/kotlin/okhttp3/internal/connection/RealCall.kt

              responseCallback.onResponse(this@RealCall, response)
            } catch (e: IOException) {
              if (signalledCallback) {
                // Do not signal the callback twice!
                Platform.get().log("Callback failure for ${toLoggableString()}", Platform.INFO, e)
              } else {
                responseCallback.onFailure(this@RealCall, e)
              }
            } catch (t: Throwable) {
              cancel()
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 20 17:03:43 GMT 2024
    - 17.9K bytes
    - Viewed (2)
  8. okhttp/src/main/kotlin/okhttp3/Dns.kt

        val SYSTEM: Dns = DnsSystem()
    
        private class DnsSystem : Dns {
          override fun lookup(hostname: String): List<InetAddress> {
            try {
              return InetAddress.getAllByName(hostname).toList()
            } catch (e: NullPointerException) {
              throw UnknownHostException("Broken system behaviour for dns lookup of $hostname").apply {
                initCause(e)
              }
            }
          }
        }
      }
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/RecordingConnectionListener.kt

        try {
          while (true) {
            val event = takeEvent()
            if (eventClass.isInstance(event)) {
              return eventClass.cast(event)
            }
          }
        } catch (e: NoSuchElementException) {
          throw AssertionError("full event sequence: $fullEventSequence", e)
        }
      }
    
      /**
       * Remove and return the next event from the recorded sequence.
       *
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/http2/MockHttp2Peer.kt

        serverSocket!!.reuseAddress = false
        serverSocket!!.bind(InetSocketAddress("localhost", 0), 1)
        port = serverSocket!!.localPort
        executor.execute {
          try {
            readAndWriteFrames()
          } catch (e: IOException) {
            ******@****.***uietly()
            logger.info("${this@MockHttp2Peer} done: ${e.message}")
          }
        }
      }
    
      private fun readAndWriteFrames() {
        check(socket == null)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Thu Apr 11 22:09:35 GMT 2024
    - 8.7K bytes
    - Viewed (0)
Back to top