2019-01-05 19:50:56 +00:00
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:21 +00:00
|
|
|
// Aaru Data Preservation Suite
|
2019-01-05 19:50:56 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : ErrorNumber.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// Component : Common types.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Defines enumerations of error numbers.
|
|
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
|
// copy of this software and associated documentation files (the
|
|
|
|
|
// "Software"), to deal in the Software without restriction, including
|
|
|
|
|
// without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
// distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
// permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
// the following conditions:
|
|
|
|
|
//
|
|
|
|
|
// The above copyright notice and this permission notice shall be included
|
|
|
|
|
// in all copies or substantial portions of the Software.
|
|
|
|
|
//
|
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
|
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
|
|
|
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
|
|
|
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
|
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
|
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2020-12-31 23:08:21 +00:00
|
|
|
// Copyright © 2011-2021 Natalia Portillo
|
2019-01-05 19:50:56 +00:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
2020-02-27 00:33:15 +00:00
|
|
|
namespace Aaru.CommonTypes.Enums
|
2019-01-05 19:50:56 +00:00
|
|
|
{
|
2021-09-16 04:42:08 +01:00
|
|
|
/// <summary>Enumerates error codes. Negative for UNIX error number equivalents, positive for Aaru error numbers.</summary>
|
2019-01-05 19:50:56 +00:00
|
|
|
public enum ErrorNumber
|
|
|
|
|
{
|
2021-09-16 04:42:08 +01:00
|
|
|
NotPermitted = -1,
|
|
|
|
|
/// <summary>No such file or directory</summary>
|
|
|
|
|
NoSuchFile = -2, NoSuchProcess = -3, InterruptedSyscall = -4,
|
|
|
|
|
/// <summary>I/O error</summary>
|
|
|
|
|
InOutError = -5, NoSuchDeviceOrAddress = -6, ArgumentListTooLong = -7, ExecutableFormatError = -8,
|
|
|
|
|
BadFileNumber = -9, NoChildProcess = -10, TryAgain = -11,
|
|
|
|
|
OutOfMemory = -12,
|
|
|
|
|
/// <summary>Access denied</summary>
|
|
|
|
|
AccessDenied = -13, BadAddress = -14, NotABlockDevice = -15,
|
|
|
|
|
/// <summary>Busy, cannot complete</summary>
|
|
|
|
|
Busy = -16, FileExists = -17, CrossDeviceLink = -18,
|
|
|
|
|
/// <summary>No such device</summary>
|
|
|
|
|
NoSuchDevice = -19,
|
|
|
|
|
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
|
|
|
|
NotDirectory = -20,
|
|
|
|
|
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
|
|
|
|
IsDirectory = -21,
|
|
|
|
|
/// <summary>Invalid argument</summary>
|
|
|
|
|
InvalidArgument = -22, FileTableOverflow = -23, TooManyOpenFiles = -24, NotTypewriter = -25,
|
|
|
|
|
TextFileBusy = -26,
|
|
|
|
|
/// <summary>File is too large</summary>
|
|
|
|
|
FileTooLarge = -27, NoSpaceLeft = -28, IllegalSeek = -29, ReadOnly = -30,
|
|
|
|
|
TooManyLinks = -31, BrokenPipe = -32, OutOfDomain = -33,
|
|
|
|
|
OutOfRange = -34, DeadlockWouldOccur = -35,
|
|
|
|
|
/// <summary>Name is too long</summary>
|
|
|
|
|
NameTooLong = -36, NoLocksAvailable = -37,
|
|
|
|
|
/// <summary>Not implemented</summary>
|
|
|
|
|
NotImplemented = -38,
|
|
|
|
|
/// <summary>There is no data available</summary>
|
|
|
|
|
NoData = -61,
|
|
|
|
|
/// <summary>Link is severed</summary>
|
|
|
|
|
SeveredLink = -67,
|
|
|
|
|
/// <summary>There is no such attribute</summary>
|
|
|
|
|
NoSuchExtendedAttribute = NoData,
|
|
|
|
|
/// <summary>Not supported</summary>
|
|
|
|
|
NotSupported = -252, EPERM = NotPermitted,
|
|
|
|
|
/// <summary>No such file or directory</summary>
|
|
|
|
|
ENOENT = NoSuchFile, ESRCH = NoSuchProcess, EINTR = InterruptedSyscall,
|
|
|
|
|
/// <summary>I/O error</summary>
|
|
|
|
|
EIO = InOutError, ENXIO = NoSuchDeviceOrAddress, E2BIG = ArgumentListTooLong, ENOEXEC = ExecutableFormatError,
|
|
|
|
|
EBADF = BadFileNumber, ECHILD = NoChildProcess, EAGAIN = TryAgain,
|
|
|
|
|
ENOMEM = OutOfMemory,
|
|
|
|
|
/// <summary>Access denied</summary>
|
|
|
|
|
EACCES = AccessDenied, EFAULT = BadAddress, ENOTBLK = NotABlockDevice,
|
|
|
|
|
/// <summary>Busy, cannot complete</summary>
|
|
|
|
|
EBUSY = Busy, EEXIST = FileExists, EXDEV = CrossDeviceLink,
|
|
|
|
|
/// <summary>No such device</summary>
|
|
|
|
|
ENODEV = NoSuchDevice,
|
|
|
|
|
/// <summary>Is not a directory (e.g.: trying to ReadDir() a file)</summary>
|
|
|
|
|
ENOTDIR = NotDirectory,
|
|
|
|
|
/// <summary>Is a directory (e.g.: trying to Read() a dir)</summary>
|
|
|
|
|
EISDIR = IsDirectory,
|
|
|
|
|
/// <summary>Invalid argument</summary>
|
|
|
|
|
EINVAL = InvalidArgument, ENFILE = FileTableOverflow, EMFILE = TooManyOpenFiles, ENOTTY = NotTypewriter,
|
|
|
|
|
ETXTBSY = TextFileBusy,
|
|
|
|
|
/// <summary>File is too large</summary>
|
|
|
|
|
EFBIG = FileTooLarge, ENOSPC = NoSpaceLeft, ESPIPE = IllegalSeek, EROFS = ReadOnly,
|
|
|
|
|
EMLINK = TooManyLinks, EPIPE = BrokenPipe, EDOM = OutOfDomain,
|
|
|
|
|
ERANGE = OutOfRange, EDEADLK = DeadlockWouldOccur,
|
|
|
|
|
/// <summary>Name is too long</summary>
|
|
|
|
|
ENAMETOOLONG = NameTooLong, ENOLCK = NoLocksAvailable,
|
|
|
|
|
/// <summary>Not implemented</summary>
|
|
|
|
|
ENOSYS = NotImplemented,
|
|
|
|
|
/// <summary>Link is severed</summary>
|
|
|
|
|
ENOLINK = SeveredLink,
|
|
|
|
|
/// <summary>Not supported</summary>
|
|
|
|
|
ENOTSUP = NotSupported, DirectoryNotEmpty = -39, TooManySymbolicLinks = -40, ENOTEMPTY = DirectoryNotEmpty,
|
|
|
|
|
ELOOP = TooManySymbolicLinks,
|
|
|
|
|
/// <summary>There is no such attribute</summary>
|
|
|
|
|
ENOATTR = NoSuchExtendedAttribute,
|
|
|
|
|
/// <summary>There is no data available</summary>
|
|
|
|
|
ENODATA = NoData,
|
2019-01-05 19:50:56 +00:00
|
|
|
/// <summary>No error</summary>
|
2020-01-08 15:26:38 +00:00
|
|
|
NoError = 0,
|
|
|
|
|
/// <summary>User requested help to be shown</summary>
|
|
|
|
|
HelpRequested = 1,
|
|
|
|
|
/// <summary>Command found nothing</summary>
|
|
|
|
|
NothingFound = 2,
|
|
|
|
|
/// <summary>Media has been already dumped completely</summary>
|
|
|
|
|
AlreadyDumped = 3,
|
|
|
|
|
/// <summary>Image and its sectors cannot be verified</summary>
|
2020-07-22 13:20:18 +01:00
|
|
|
NotVerifiable = 4,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>There are bad sectors and image cannot be verified</summary>
|
|
|
|
|
BadSectorsImageNotVerified = 5,
|
|
|
|
|
/// <summary>All sectors are good and image cannot be verified</summary>
|
|
|
|
|
CorrectSectorsImageNotVerified = 6,
|
|
|
|
|
/// <summary>Image is bad and sectors cannot be verified</summary>
|
|
|
|
|
BadImageSectorsNotVerified = 7,
|
|
|
|
|
/// <summary>Image is bad and there are bad sectors</summary>
|
|
|
|
|
BadImageBadSectors = 8,
|
|
|
|
|
/// <summary>All sectors are good and image is bad</summary>
|
|
|
|
|
CorrectSectorsBadImage = 9,
|
|
|
|
|
/// <summary>Image is good and sectors cannot be verified</summary>
|
|
|
|
|
CorrectImageSectorsNotVerified = 10,
|
|
|
|
|
/// <summary>Image is good and there are bad sectors</summary>
|
|
|
|
|
CorrectImageBadSectors = 11,
|
|
|
|
|
/// <summary>Exception has been raised</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
UnexpectedException = 12,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The number of arguments is not as expected</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
UnexpectedArgumentCount = 13,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>A required argument is not present</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
MissingArgument = 14,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified file cannot be opened</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
CannotOpenFile = 15,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified encoding cannot be found</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
EncodingUnknown = 16,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The image format has not been recognized</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
UnrecognizedFormat = 17,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The image format failed to open</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
CannotOpenFormat = 18,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified metadata sidecar does not have the correct format</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
InvalidSidecar = 19,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified resume map does not have the correct format</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
InvalidResume = 20,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified image format cannot be found</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
FormatNotFound = 21,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>More than one format found for the specified search criteria</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
TooManyFormats = 22,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>The specified format does not support the specified media</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
UnsupportedMedia = 23,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>Data will be lost writing the specified format</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
DataWillBeLost = 24,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>Cannot create destination format</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
CannotCreateFormat = 25,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>Error writing data</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
WriteError = 26,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>Cannot open device</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
CannotOpenDevice = 27,
|
2020-01-08 15:26:38 +00:00
|
|
|
/// <summary>Cannot remove the existing database</summary>
|
2021-09-16 04:42:08 +01:00
|
|
|
CannotRemoveDatabase = -28
|
2019-01-05 19:50:56 +00:00
|
|
|
}
|
|
|
|
|
}
|