|
System.IO.Error | Portability | portable | Stability | provisional | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
Standard IO Errors.
|
|
Synopsis |
|
|
|
|
I/O errors
|
|
|
The Haskell 98 type for exceptions in the IO monad.
Any I/O operation may raise an IOError instead of returning a result.
For a more general type of exception, including also those that arise
in pure code, see Control.Exception.Exception.
In Haskell 98, this is an opaque type.
|
|
|
Construct an IOError value with a string describing the error.
The fail method of the IO instance of the Monad class raises a
userError, thus:
instance Monad IO where
...
fail s = ioError (userError s)
|
|
|
Construct an IOError of the given type where the second argument
describes the error location and the third and fourth argument
contain the file handle and file path of the file involved in the
error if applicable.
|
|
|
Adds a location description and maybe a file path and file handle
to an IOError. If any of the file handle or file path is not given
the corresponding value in the IOError remains unaltered.
|
|
Classifying I/O errors
|
|
|
An error indicating that an IO operation failed because
one of its arguments already exists.
|
|
|
An error indicating that an IO operation failed because
one of its arguments does not exist.
|
|
|
An error indicating that an IO operation failed because
one of its arguments is a single-use resource, which is already
being used (for example, opening the same file twice for writing
might give this error).
|
|
|
An error indicating that an IO operation failed because
the device is full.
|
|
|
An error indicating that an IO operation failed because
the end of file has been reached.
|
|
|
An error indicating that an IO operation failed because
the operation was not possible.
Any computation which returns an IO result may fail with
isIllegalOperation. In some cases, an implementation will not be
able to distinguish between the possible error causes. In this case
it should fail with isIllegalOperation.
|
|
|
An error indicating that an IO operation failed because
the user does not have sufficient operating system privilege
to perform that operation.
|
|
|
A programmer-defined error value constructed using userError.
|
|
Attributes of I/O errors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Types of I/O error
|
|
|
An abstract type that contains a value for each variant of IOError.
| Instances | |
|
|
|
I/O error where the operation failed because one of its arguments
already exists.
|
|
|
I/O error where the operation failed because one of its arguments
does not exist.
|
|
|
I/O error where the operation failed because one of its arguments
is a single-use resource, which is already being used.
|
|
|
I/O error where the operation failed because the device is full.
|
|
|
I/O error where the operation failed because the end of file has
been reached.
|
|
|
I/O error where the operation is not possible.
|
|
|
I/O error where the operation failed because the user does not
have sufficient operating system privilege to perform that operation.
|
|
|
I/O error that is programmer-defined.
|
|
IOErrorType predicates
|
|
|
I/O error where the operation failed because one of its arguments
already exists.
|
|
|
I/O error where the operation failed because one of its arguments
does not exist.
|
|
|
I/O error where the operation failed because one of its arguments
is a single-use resource, which is already being used.
|
|
|
I/O error where the operation failed because the device is full.
|
|
|
I/O error where the operation failed because the end of file has
been reached.
|
|
|
I/O error where the operation is not possible.
|
|
|
I/O error where the operation failed because the user does not
have sufficient operating system privilege to perform that operation.
|
|
|
I/O error that is programmer-defined.
|
|
Throwing and catching I/O errors
|
|
|
Raise an IOError in the IO monad.
|
|
catch |
|
|
The construct try comp exposes IO errors which occur within a
computation, and which are not fully handled.
Non-I/O exceptions are not caught by this variant; to catch all
exceptions, use Control.Exception.try from Control.Exception.
|
|
|
Catch any IOError that occurs in the computation and throw a
modified version.
|
|
Produced by Haddock version 2.4.2 |