// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : ErrorNumber.cs // Author(s) : Natalia Portillo // // 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. // // ---------------------------------------------------------------------------- // Copyright © 2011-2023 Natalia Portillo // ****************************************************************************/ using System.Diagnostics.CodeAnalysis; namespace Aaru.CommonTypes.Enums; /// Enumerates error codes. Negative for UNIX error number equivalents, positive for Aaru error numbers. [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedMember.Global"), SuppressMessage("ReSharper", "IdentifierTypo")] public enum ErrorNumber { /// Operation not permitted NotPermitted = -1, /// No such file or directory NoSuchFile = -2, /// No such process NoSuchProcess = -3, /// System call interrupted InterruptedSyscall = -4, /// I/O error InOutError = -5, /// No such device or address NoSuchDeviceOrAddress = -6, /// The argument list is too long ArgumentListTooLong = -7, /// Error loading the executable format ExecutableFormatError = -8, /// Bad file descriptor BadFileNumber = -9, /// No child process NoChildProcess = -10, /// Try again TryAgain = -11, /// Process ran out of memory OutOfMemory = -12, /// Access denied AccessDenied = -13, /// Bad address BadAddress = -14, /// File is not a block device NotABlockDevice = -15, /// Busy, cannot complete Busy = -16, /// File already exists FileExists = -17, /// Tried to create a link that crosses devices CrossDeviceLink = -18, /// No such device NoSuchDevice = -19, /// Is not a directory (e.g.: trying to ReadDir() a file) NotDirectory = -20, /// Is a directory (e.g.: trying to Read() a dir) IsDirectory = -21, /// Invalid argument InvalidArgument = -22, /// File table overflow FileTableOverflow = -23, /// Too many open files TooManyOpenFiles = -24, /// Destination is not a TTY NotTypewriter = -25, /// Text file busy TextFileBusy = -26, /// File is too large FileTooLarge = -27, /// No space left on volume NoSpaceLeft = -28, /// Illegal seek requested IllegalSeek = -29, /// Tried a write operation on a read-only device ReadOnly = -30, /// Too many links TooManyLinks = -31, /// Broken pipe BrokenPipe = -32, /// Out of domain OutOfDomain = -33, /// Out of range OutOfRange = -34, /// Operation would incur in a deadlock DeadlockWouldOccur = -35, /// Name is too long NameTooLong = -36, /// There are no available locks NoLocksAvailable = -37, /// Not implemented NotImplemented = -38, /// There is no data available NoData = -61, /// Link is severed SeveredLink = -67, /// There is no such attribute NoSuchExtendedAttribute = NoData, /// Not supported NotSupported = -252, /// Operation not permitted EPERM = NotPermitted, /// No such file or directory ENOENT = NoSuchFile, /// No such process ESRCH = NoSuchProcess, /// System call interrupted EINTR = InterruptedSyscall, /// I/O error EIO = InOutError, /// No such device or address ENXIO = NoSuchDeviceOrAddress, /// The argument list is too long E2BIG = ArgumentListTooLong, /// Error loading the executable format ENOEXEC = ExecutableFormatError, /// Bad file descriptor EBADF = BadFileNumber, /// No child process ECHILD = NoChildProcess, /// Try again EAGAIN = TryAgain, /// Process ran out of memory ENOMEM = OutOfMemory, /// Access denied EACCES = AccessDenied, /// Bad address EFAULT = BadAddress, /// File is not a block device ENOTBLK = NotABlockDevice, /// Busy, cannot complete EBUSY = Busy, /// File already exists EEXIST = FileExists, /// Tried to create a link that crosses devices EXDEV = CrossDeviceLink, /// No such device ENODEV = NoSuchDevice, /// Is not a directory (e.g.: trying to ReadDir() a file) ENOTDIR = NotDirectory, /// Is a directory (e.g.: trying to Read() a dir) EISDIR = IsDirectory, /// Invalid argument EINVAL = InvalidArgument, /// File table overflow ENFILE = FileTableOverflow, /// Too many open files EMFILE = TooManyOpenFiles, /// Destination is not a TTY ENOTTY = NotTypewriter, /// Text file busy ETXTBSY = TextFileBusy, /// File is too large EFBIG = FileTooLarge, /// No space left on volume ENOSPC = NoSpaceLeft, /// Illegal seek requested ESPIPE = IllegalSeek, /// Tried a write operation on a read-only device EROFS = ReadOnly, /// Too many links EMLINK = TooManyLinks, /// Broken pipe EPIPE = BrokenPipe, /// Out of domain EDOM = OutOfDomain, /// Out of range ERANGE = OutOfRange, /// Operation would incur in a deadlock EDEADLK = DeadlockWouldOccur, /// Name is too long ENAMETOOLONG = NameTooLong, /// There are no available locks ENOLCK = NoLocksAvailable, /// Not implemented ENOSYS = NotImplemented, /// Link is severed ENOLINK = SeveredLink, /// Not supported ENOTSUP = NotSupported, /// Directory is not empty DirectoryNotEmpty = -39, /// Too many symbolic links encountered TooManySymbolicLinks = -40, /// Directory is not empty ENOTEMPTY = DirectoryNotEmpty, /// Too many symbolic links encountered ELOOP = TooManySymbolicLinks, /// There is no such attribute ENOATTR = NoSuchExtendedAttribute, /// There is no data available ENODATA = NoData, /// No error NoError = 0, /// User requested help to be shown HelpRequested = 1, /// Command found nothing NothingFound = 2, /// Media has been already dumped completely AlreadyDumped = 3, /// Image and its sectors cannot be verified NotVerifiable = 4, /// There are bad sectors and image cannot be verified BadSectorsImageNotVerified = 5, /// All sectors are good and image cannot be verified CorrectSectorsImageNotVerified = 6, /// Image is bad and sectors cannot be verified BadImageSectorsNotVerified = 7, /// Image is bad and there are bad sectors BadImageBadSectors = 8, /// All sectors are good and image is bad CorrectSectorsBadImage = 9, /// Image is good and sectors cannot be verified CorrectImageSectorsNotVerified = 10, /// Image is good and there are bad sectors CorrectImageBadSectors = 11, /// Exception has been raised UnexpectedException = 12, /// The number of arguments is not as expected UnexpectedArgumentCount = 13, /// A required argument is not present MissingArgument = 14, /// The specified file cannot be opened CannotOpenFile = 15, /// The specified encoding cannot be found EncodingUnknown = 16, /// The image format has not been recognized UnrecognizedFormat = 17, /// The image format failed to open CannotOpenFormat = 18, /// The specified metadata sidecar does not have the correct format InvalidSidecar = 19, /// The specified resume map does not have the correct format InvalidResume = 20, /// The specified image format cannot be found FormatNotFound = 21, /// More than one format found for the specified search criteria TooManyFormats = 22, /// The specified format does not support the specified media UnsupportedMedia = 23, /// Data will be lost writing the specified format DataWillBeLost = 24, /// Cannot create destination format CannotCreateFormat = 25, /// Error writing data WriteError = 26, /// Cannot open device CannotOpenDevice = 27, /// Cannot remove the existing database CannotRemoveDatabase = 28, /// Specified sector could not be found SectorNotFound = 29, /// Image or device has not been opened NotOpened = 30 }