Exceptions that may be thrown in the IO monad.
Many of the constructors of IO.Error correspond to POSIX error numbers. In these cases, the
documentation string lists POSIX standard error macros that correspond to the error. This list is
not necessarily exhaustive, and these constructor includes a field for the underlying error number.
- alreadyExists
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorThe operation failed because a file already exists. This corresponds to POSIX errors EEXIST,EINPROGRESS, andEISCONN.
- otherError
(osCode : UInt32)
(details : String)
 : ErrorSome error not covered by the other constructors of IO.Erroroccurred.This also includes POSIX error EFAULT.
- resourceBusy
(osCode : UInt32)
(details : String)
 : ErrorA necessary resource was busy. This corresponds to POSIX errors EADDRINUSE,EBUSY,EDEADLK, andETXTBSY.
- resourceVanished
(osCode : UInt32)
(details : String)
 : ErrorA necessary resource is no longer available. This corresponds to POSIX errors ECONNRESET,EIDRM,ENETDOWN,ENETRESET,ENOLINK, andEPIPE.
- unsupportedOperation
(osCode : UInt32)
(details : String)
 : ErrorAn operation was not supported. This corresponds to POSIX errors EADDRNOTAVAIL,EAFNOSUPPORT,ENODEV,ENOPROTOOPTENOSYS,EOPNOTSUPP,ERANGE,ESPIPE, andEXDEV.
- hardwareFault
(osCode : UInt32)
(details : String)
 : ErrorThe operation failed due to a hardware problem, such as an I/O error. This corresponds to the POSIX error EIO.
- unsatisfiedConstraints
(osCode : UInt32)
(details : String)
 : ErrorA constraint required by an operation was not satisfied (e.g. a directory was not empty). This corresponds to the POSIX error ENOTEMPTY.
- illegalOperation
(osCode : UInt32)
(details : String)
 : ErrorAn inappropriate I/O control operation was attempted. This corresponds to the POSIX error ENOTTY.
- protocolError
(osCode : UInt32)
(details : String)
 : ErrorA protocol error occurred. This corresponds to the POSIX errors EPROTO,EPROTONOSUPPORT, andEPROTOTYPE.
- timeExpired
(osCode : UInt32)
(details : String)
 : ErrorAn operation timed out. This corresponds to the POSIX errors ETIME, andETIMEDOUT.
- interrupted
(filename : String)
(osCode : UInt32)
(details : String)
 : ErrorThe operation was interrupted. This corresponds to the POSIX error EINTR.
- noFileOrDirectory
(filename : String)
(osCode : UInt32)
(details : String)
 : ErrorNo such file or directory. This corresponds to the POSIX error ENOENT.
- invalidArgument
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorAn argument to an I/O operation was invalid. This corresponds to the POSIX errors ELOOP,ENAMETOOLONG,EDESTADDRREQ,EILSEQ,EINVAL,EDOM,EBADFENOEXEC,ENOSTR,ENOTCONN, andENOTSOCK.
- permissionDenied
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorAn operation failed due to insufficient permissions. This corresponds to the POSIX errors EACCES,EROFS,ECONNABORTED,EFBIG, andEPERM.
- resourceExhausted
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorA resource was exhausted. This corresponds to the POSIX errors EMFILE,ENFILE,ENOSPC,E2BIG,EAGAIN,EMLINK,EMSGSIZE,ENOBUFS,ENOLCK,ENOMEM, andENOSR.
- inappropriateType
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorAn argument was the wrong type (e.g. a directory when a file was required). This corresponds to the POSIX errors EISDIR,EBADMSG, andENOTDIR.
- noSuchThing
(filename : Option String)
(osCode : UInt32)
(details : String)
 : ErrorA required resource does not exist. This corresponds to the POSIX errors ENXIO,EHOSTUNREACH,ENETUNREACH,ECHILD,ECONNREFUSED,ENODATA,ENOMSG, andESRCH.
- unexpectedEof : ErrorAn unexpected end-of-file marker was encountered. 
- userError
(msg : String)
 : ErrorSome other error occurred. 
Instances For
Equations
- instInhabitedError = { default := IO.Error.userError "(`Inhabited.default` for `IO.Error`)" }
Equations
- instCoeStringError = { coe := IO.userError }
Instances For
Equations
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Instances For
Equations
Instances For
Instances For
Instances For
Instances For
Instances For
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
- IO.Error.fopenErrorToString gist fn code none = IO.Error.downCaseFirst✝ gist ++ " (error code: " ++ toString code ++ ")\n file: " ++ fn
Instances For
Equations
- IO.Error.otherErrorToString gist code (some details) = IO.Error.downCaseFirst✝ gist ++ " (error code: " ++ toString code ++ ", " ++ IO.Error.downCaseFirst✝¹ details ++ ")"
- IO.Error.otherErrorToString gist code none = IO.Error.downCaseFirst✝ gist ++ " (error code: " ++ toString code ++ ")"
Instances For
Converts an IO.Error to a descriptive string.
IO.Error.userError is converted to its embedded message. The other constructors are converted in a
way that preserves structured information, such as error codes and filenames, that can help
diagnose the issue.
Equations
- IO.Error.unexpectedEof.toString = "end of file"
- (IO.Error.inappropriateType (some fn) code details).toString = IO.Error.fopenErrorToString "inappropriate type" fn code (some details)
- (IO.Error.inappropriateType none code details).toString = IO.Error.otherErrorToString "inappropriate type" code (some details)
- (IO.Error.interrupted fn code details).toString = IO.Error.fopenErrorToString "interrupted system call" fn code (some details)
- (IO.Error.invalidArgument (some fn) code details).toString = IO.Error.fopenErrorToString "invalid argument" fn code (some details)
- (IO.Error.invalidArgument none code details).toString = IO.Error.otherErrorToString "invalid argument" code (some details)
- (IO.Error.noFileOrDirectory fn code details).toString = IO.Error.fopenErrorToString "no such file or directory" fn code none
- (IO.Error.noSuchThing (some fn) code details).toString = IO.Error.fopenErrorToString "no such thing" fn code (some details)
- (IO.Error.noSuchThing none code details).toString = IO.Error.otherErrorToString "no such thing" code (some details)
- (IO.Error.permissionDenied (some fn) code details).toString = IO.Error.fopenErrorToString details fn code none
- (IO.Error.permissionDenied none code details).toString = IO.Error.otherErrorToString details code none
- (IO.Error.resourceExhausted (some fn) code details).toString = IO.Error.fopenErrorToString "resource exhausted" fn code (some details)
- (IO.Error.resourceExhausted none code details).toString = IO.Error.otherErrorToString "resource exhausted" code (some details)
- (IO.Error.alreadyExists none code details).toString = IO.Error.otherErrorToString "already exists" code (some details)
- (IO.Error.alreadyExists (some fn) code details).toString = IO.Error.fopenErrorToString "already exists" fn code (some details)
- (IO.Error.otherError code details).toString = IO.Error.otherErrorToString details code none
- (IO.Error.resourceBusy code details).toString = IO.Error.otherErrorToString "resource busy" code (some details)
- (IO.Error.resourceVanished code details).toString = IO.Error.otherErrorToString "resource vanished" code (some details)
- (IO.Error.hardwareFault code details).toString = IO.Error.otherErrorToString "hardware fault" code none
- (IO.Error.illegalOperation code details).toString = IO.Error.otherErrorToString "illegal operation" code (some details)
- (IO.Error.protocolError code details).toString = IO.Error.otherErrorToString "protocol error" code (some details)
- (IO.Error.timeExpired code details).toString = IO.Error.otherErrorToString "time expired" code (some details)
- (IO.Error.unsatisfiedConstraints code details).toString = IO.Error.otherErrorToString "directory not empty" code none
- (IO.Error.unsupportedOperation code details).toString = IO.Error.otherErrorToString "unsupported operation" code (some details)
- (IO.Error.userError msg).toString = msg
Instances For
Equations
- IO.Error.instToString = { toString := IO.Error.toString }