Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

toError

Public Function
std.crypto.tls.Alert.Description.toError
pub fn toError(description: Description) Error!void

Params

File

crypto/tls.zig:211
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
        pub fn toError(description: Description) Error!void {
            switch (description) {
                .close_notify => {}, // not an error
                .unexpected_message => return error.TlsAlertUnexpectedMessage,
                .bad_record_mac => return error.TlsAlertBadRecordMac,
                .record_overflow => return error.TlsAlertRecordOverflow,
                .handshake_failure => return error.TlsAlertHandshakeFailure,
                .bad_certificate => return error.TlsAlertBadCertificate,
                .unsupported_certificate => return error.TlsAlertUnsupportedCertificate,
                .certificate_revoked => return error.TlsAlertCertificateRevoked,
                .certificate_expired => return error.TlsAlertCertificateExpired,
                .certificate_unknown => return error.TlsAlertCertificateUnknown,
                .illegal_parameter => return error.TlsAlertIllegalParameter,
                .unknown_ca => return error.TlsAlertUnknownCa,
                .access_denied => return error.TlsAlertAccessDenied,
                .decode_error => return error.TlsAlertDecodeError,
                .decrypt_error => return error.TlsAlertDecryptError,
                .protocol_version => return error.TlsAlertProtocolVersion,
                .insufficient_security => return error.TlsAlertInsufficientSecurity,
                .internal_error => return error.TlsAlertInternalError,
                .inappropriate_fallback => return error.TlsAlertInappropriateFallback,
                .user_canceled => {}, // not an error
                .missing_extension => return error.TlsAlertMissingExtension,
                .unsupported_extension => return error.TlsAlertUnsupportedExtension,
                .unrecognized_name => return error.TlsAlertUnrecognizedName,
                .bad_certificate_status_response => return error.TlsAlertBadCertificateStatusResponse,
                .unknown_psk_identity => return error.TlsAlertUnknownPskIdentity,
                .certificate_required => return error.TlsAlertCertificateRequired,
                .no_application_protocol => return error.TlsAlertNoApplicationProtocol,
                _ => return error.TlsAlertUnknown,
            }
        }