apple / swift-nio-ssl

TLS Support for SwiftNIO, based on BoringSSL.
https://swiftpackageindex.com/apple/swift-nio-ssl/main/documentation/niossl
Apache License 2.0
388 stars 139 forks source link

Include file path in `IOError`s thrown by `fopen` #375

Closed dnadoba closed 2 years ago

dnadoba commented 2 years ago

Motivation

If a certificate, private key or bundle can not be loaded from the file system, we get an IOError with a description that looks like this:

fopen(file:mode:): No such file or directory (errno: 2)

It would be nice if the error description would also include the file path of the file that could not be found.

Modifications

Result

Better error description:

fopen(file: "/nonexistent/path", mode: "rb"): No such file or directory (errno: 2)