Scoop API

scoop:scoop.tls:0.1.0

src/errors.scoop

Selected production source · src/errors.scoop

1package scoop.tls
3/**
4 * The configuration, peer verification, or protocol reason a TLS operation failed.
5 */
6public enum TlsFailureKind {
7 /**
8 * The requested TLS configuration is invalid or unavailable.
9 */
10 Configuration,
11 /**
12 * Certificate or peer-identity verification failed.
13 */
14 Verification,
15 /**
16 * The TLS protocol operation failed.
17 */
18 Protocol,
19 /**
20 * The transport ended before a valid TLS close notification.
21 */
22 Truncated,
23 /**
24 * Application data remains where the requested TLS shutdown requires it to be consumed.
25 */
26 UnconsumedData }
28/**
29 * A TLS failure with structured operation, TLS/backend, certificate-verification, and system-error
30 * details.
31 */
32public class TlsException public constructor(
33 /**
34 * The handshake, transfer, verification, or configuration operation that failed.
35 */
36 public val operation: String,
37 /**
38 * The structured category of the TLS failure.
39 */
40 public val kind: TlsFailureKind,
41 /**
42 * The native TLS backend error code reported for the failure.
43 */
44 public val code: ULong,
45 /**
46 * The certificate-verification result code reported by the backend.
47 */
48 public val verifyCode: Long,
49 /**
50 * The system error associated with the failed native operation.
51 */
52 public val systemError: Int,
53 /**
54 * A human-readable description of the failure.
55 */
56 public val detail: String
57) : Exception(Some(operation + ": " + detail))