You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FileDescriptor.open(_:_:options:permissions:retryOnInterrupt:)traps if options.contains(.create) and permissions is nil. since its callers can throw, why not throw an error instead?
alternatively, if this isn’t appropriate for throws, it should be a fatalError instead of a precondition, so users don’t have to hunt through source code to figure out why FileDescriptor is crashing…
The text was updated successfully, but these errors were encountered:
actually come to think of it, this would not be a good use of throws, since it’s a programmer error. still, it would be better to print the message in the crash dump with a fatalError
tayloraswift
changed the title
FileDescriptor.open(_:_:options:permissions:retryOnInterrupt:) should throw an error instead of trapping on unspecified permissions
FileDescriptor.open(_:_:options:permissions:retryOnInterrupt:) should print an error message when trapping on unspecified permissions
Mar 2, 2022
FileDescriptor.open(_:_:options:permissions:retryOnInterrupt:)
traps ifoptions.contains(.create)
andpermissions
isnil
. since its callers canthrow
, why not throw an error instead?alternatively, if this isn’t appropriate for
throws
, it should be afatalError
instead of aprecondition
, so users don’t have to hunt through source code to figure out whyFileDescriptor
is crashing…The text was updated successfully, but these errors were encountered: