Added a *lot* of error strings.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2269 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <Errors.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <kerrors.h>
|
||||
|
||||
@@ -14,37 +15,45 @@ strerror(int errnum)
|
||||
{
|
||||
switch (errnum) {
|
||||
/* General Errors */
|
||||
// B_OK
|
||||
case B_NO_ERROR:
|
||||
return "No Error";
|
||||
|
||||
// B_ERROR
|
||||
case ERR_GENERAL:
|
||||
return "General Error";
|
||||
|
||||
// B_INTERRUPTED
|
||||
case EINTR:
|
||||
return "Interrupted";
|
||||
|
||||
return "Interrupted system call";
|
||||
|
||||
// B_NO_MEMORY:
|
||||
case ENOMEM:
|
||||
return "Cannot allocate memory";
|
||||
return "Cannot allocate memory"; // "No memory"
|
||||
|
||||
// B_IO_ERROR
|
||||
// EIO
|
||||
case ERR_IO_ERROR:
|
||||
return "Input/Output error";
|
||||
return "Input/Output error"; // "I/O Error"
|
||||
|
||||
// B_BAD_VALUE:
|
||||
case EINVAL:
|
||||
return "Invalid Arguments";
|
||||
return "Invalid Argument";
|
||||
|
||||
// B_TIMED_OUT
|
||||
// case ERR_TIMED_OUT:
|
||||
case ETIMEDOUT:
|
||||
return "Timed out";
|
||||
return "Timed out"; // "Operation timed out"
|
||||
|
||||
// B_NOT_ALLOWED
|
||||
// case ERR_NOT_ALLOWED:
|
||||
case EPERM:
|
||||
return "Operation not permitted";
|
||||
return "Operation not permitted"; // "Operation not allowed"
|
||||
|
||||
// B_PERMISSION_DENIED
|
||||
// case ERR_PERMISSION_DENIED:
|
||||
case EACCES:
|
||||
return "Operation not permitted";
|
||||
return "Operation not permitted"; // "Permission denied"
|
||||
|
||||
case ERR_INVALID_BINARY:
|
||||
return "Invalid Binary";
|
||||
@@ -56,31 +65,34 @@ strerror(int errnum)
|
||||
case ERR_NO_MORE_HANDLES:
|
||||
return "No more handles";
|
||||
|
||||
// B_FILE_ERROR
|
||||
case EBADF:
|
||||
return "Bad file descriptor";
|
||||
|
||||
// B_ENTRY_NOT_FOUND
|
||||
case ENOENT:
|
||||
return "No such file or directory";
|
||||
|
||||
case ENFILE:
|
||||
return "Too many open files in system";
|
||||
|
||||
return "Too many open files in system"; // "File table overflow"
|
||||
|
||||
// B_NO_MORE_FDS
|
||||
case EMFILE:
|
||||
return "Too many open files";
|
||||
|
||||
case ENXIO:
|
||||
return "Device not configured";
|
||||
return "Device not configured"; // "No such device"
|
||||
|
||||
case ESPIPE:
|
||||
return "Illegal seek";
|
||||
return "Illegal seek"; // "Seek not allowed on file descriptor"
|
||||
|
||||
// case ERR_UNIMPLEMENTED:
|
||||
case ENOSYS:
|
||||
return "Unimplemented";
|
||||
return "Unimplemented"; // "Function not implemented"
|
||||
|
||||
// case ERR_TOO_BIG:
|
||||
case EDOM:
|
||||
return "Numerical argument out of range";
|
||||
return "Numerical argument out of range"; // "Domain Error"
|
||||
|
||||
case ERR_NOT_FOUND:
|
||||
return "Not found";
|
||||
@@ -91,10 +103,10 @@ strerror(int errnum)
|
||||
|
||||
/* Semaphore errors */
|
||||
case B_BAD_SEM_ID:
|
||||
return "Bad sem id";
|
||||
return "Bad semaphore id";
|
||||
|
||||
case B_NO_MORE_SEMS:
|
||||
return "Semaphore out of slots";
|
||||
return "Semaphore out of slots"; // "No more semaphores"
|
||||
|
||||
case ERR_SEM_NOT_INTERRUPTABLE:
|
||||
return "Semaphore not interruptable";
|
||||
@@ -121,19 +133,22 @@ strerror(int errnum)
|
||||
|
||||
// case ERR_VFS_INSUFFICIENT_BUF:
|
||||
case ENOBUFS:
|
||||
return "VFS insufficient buffer";
|
||||
return "VFS insufficient buffer"; // "No buffer space available"
|
||||
|
||||
// B_READ_ONLY_DEVICE
|
||||
// case ERR_VFS_READONLY_FS:
|
||||
case EROFS:
|
||||
return "VFS readonly filesystem";
|
||||
return "VFS readonly filesystem"; // "Read-only file system"
|
||||
|
||||
// B_FILE_EXISTS
|
||||
// case ERR_VFS_ALREADY_EXISTS:
|
||||
case EEXIST:
|
||||
return "VFS already exists";
|
||||
return "VFS already exists"; // "File or Directory already exists"
|
||||
|
||||
// B_BUSY
|
||||
// case ERR_VFS_FS_BUSY:
|
||||
case EBUSY:
|
||||
return "Device busy";
|
||||
return "Device busy"; // "Device/File/Resource busy"
|
||||
|
||||
case ERR_VFS_FD_TABLE_FULL:
|
||||
return "VFS file descriptor table full";
|
||||
@@ -144,6 +159,7 @@ strerror(int errnum)
|
||||
case ERR_VFS_DIR_NOT_EMPTY:
|
||||
return "Directory not empty";
|
||||
|
||||
// B_NOT_A_DIRECTORY
|
||||
// case ERR_VFS_NOT_DIR:
|
||||
case ENOTDIR:
|
||||
return "Not a directory";
|
||||
@@ -197,13 +213,388 @@ strerror(int errnum)
|
||||
|
||||
/* Ports errors */
|
||||
case B_BAD_PORT_ID:
|
||||
return "Port does not exist";
|
||||
return "Port does not exist"; // "Bad port ID"
|
||||
|
||||
case B_NO_MORE_PORTS:
|
||||
return "No more ports available";
|
||||
return "No more ports available"; // "No more ports"
|
||||
|
||||
default:
|
||||
return "Unknown error";
|
||||
case B_BAD_INDEX:
|
||||
return "Index not in range for the data set";
|
||||
|
||||
case B_BAD_TYPE:
|
||||
return "Bad argument type passed to function";
|
||||
|
||||
case B_MISMATCHED_VALUES:
|
||||
return "Mismatched values passed to function";
|
||||
|
||||
case B_NAME_NOT_FOUND:
|
||||
return "Name not found";
|
||||
|
||||
case B_NAME_IN_USE:
|
||||
return "Name in use";
|
||||
|
||||
case B_WOULD_BLOCK:
|
||||
// EAGAIN
|
||||
// EWOULDBLOCK
|
||||
return "Operation would block";
|
||||
|
||||
case B_CANCELED:
|
||||
return "Operation canceled";
|
||||
|
||||
case B_NO_INIT:
|
||||
return "Initialization failed";
|
||||
|
||||
case B_BAD_THREAD_ID:
|
||||
return "Bad thread ID";
|
||||
|
||||
case B_NO_MORE_THREADS:
|
||||
return "No more threads";
|
||||
|
||||
case B_BAD_THREAD_STATE:
|
||||
return "Thread is inappropriate state";
|
||||
|
||||
case B_BAD_TEAM_ID:
|
||||
return "Operation on invalid team";
|
||||
|
||||
case B_NO_MORE_TEAMS:
|
||||
return "No more teams";
|
||||
|
||||
case B_BAD_IMAGE_ID:
|
||||
return "Bad image ID";
|
||||
|
||||
case B_BAD_ADDRESS:
|
||||
// EFAULT
|
||||
return "Bad address";
|
||||
|
||||
case B_NOT_AN_EXECUTABLE:
|
||||
// ENOEXEC
|
||||
return "Not an executable";
|
||||
|
||||
case B_MISSING_LIBRARY:
|
||||
return "Missing library";
|
||||
|
||||
case B_MISSING_SYMBOL:
|
||||
return "Symbol not found";
|
||||
|
||||
case B_DEBUGGER_ALREADY_INSTALLED:
|
||||
return "Debugger already installed for this team";
|
||||
|
||||
case B_APP_ERROR_BASE:
|
||||
// B_BAD_REPLY
|
||||
return "Invalid or unwanted reply";
|
||||
|
||||
case B_DUPLICATE_REPLY:
|
||||
return "Duplicate reply";
|
||||
|
||||
case B_MESSAGE_TO_SELF:
|
||||
return "Can't send message to self";
|
||||
|
||||
case B_BAD_HANDLER:
|
||||
return "Bad handler";
|
||||
|
||||
case B_ALREADY_RUNNING:
|
||||
return "Already running";
|
||||
|
||||
case B_LAUNCH_FAILED:
|
||||
return "Launch failed";
|
||||
|
||||
case B_AMBIGUOUS_APP_LAUNCH:
|
||||
return "Ambiguous app launch";
|
||||
|
||||
case B_UNKNOWN_MIME_TYPE:
|
||||
return "Unknown MIME type";
|
||||
|
||||
case B_BAD_SCRIPT_SYNTAX:
|
||||
return "Bad script syntax";
|
||||
|
||||
case B_LAUNCH_FAILED_NO_RESOLVE_LINK:
|
||||
return "Could not resolve a link";
|
||||
|
||||
case B_LAUNCH_FAILED_EXECUTABLE:
|
||||
return "File is mistakenly marked as executable";
|
||||
|
||||
case B_LAUNCH_FAILED_APP_NOT_FOUND:
|
||||
return "Application could not be found";
|
||||
|
||||
case B_LAUNCH_FAILED_APP_IN_TRASH:
|
||||
return "Application is in the trash";
|
||||
|
||||
case B_LAUNCH_FAILED_NO_PREFERRED_APP:
|
||||
return "There is no preferred application for this type of file";
|
||||
|
||||
case B_LAUNCH_FAILED_FILES_APP_NOT_FOUND:
|
||||
return "This file has a preferred app, but it could not be found";
|
||||
|
||||
case B_BAD_MIME_SNIFFER_RULE:
|
||||
return "Bad sniffer rule";
|
||||
|
||||
case B_STREAM_NOT_FOUND:
|
||||
return "Stream not found";
|
||||
|
||||
case B_SERVER_NOT_FOUND:
|
||||
return "Server not found";
|
||||
|
||||
case B_RESOURCE_NOT_FOUND:
|
||||
return "Resource not found";
|
||||
|
||||
case B_RESOURCE_UNAVAILABLE:
|
||||
return "Resource unavailable";
|
||||
|
||||
case B_BAD_SUBSCRIBER:
|
||||
return "Bad subscriber";
|
||||
|
||||
case B_SUBSCRIBER_NOT_ENTERED:
|
||||
return "Subscriber not entered";
|
||||
|
||||
case B_BUFFER_NOT_AVAILABLE:
|
||||
return "Buffer not available";
|
||||
|
||||
case B_LAST_BUFFER_ERROR:
|
||||
return "Last buffer";
|
||||
|
||||
case B_FILE_NOT_FOUND:
|
||||
return "File not found";
|
||||
|
||||
case B_NAME_TOO_LONG:
|
||||
// ENAMETOOLONG
|
||||
return "File name too long";
|
||||
|
||||
case B_DIRECTORY_NOT_EMPTY:
|
||||
// ENOTEMPTY
|
||||
return "Directory not empty";
|
||||
|
||||
case B_DEVICE_FULL:
|
||||
// ENOSPC
|
||||
return "No space left on device";
|
||||
|
||||
case B_IS_A_DIRECTORY:
|
||||
// EISDIR
|
||||
return "Is a directory";
|
||||
|
||||
case B_CROSS_DEVICE_LINK:
|
||||
// EXDEV
|
||||
return "Cross-device link";
|
||||
|
||||
case B_LINK_LIMIT:
|
||||
// ELOOP
|
||||
return "Too many symbolic links";
|
||||
|
||||
case B_BUSTED_PIPE:
|
||||
// EPIPE
|
||||
return "Broken pipe";
|
||||
|
||||
case B_UNSUPPORTED:
|
||||
return "Operation not supported";
|
||||
|
||||
case B_PARTITION_TOO_SMALL:
|
||||
return "Partition too small to contain filesystem";
|
||||
|
||||
case E2BIG:
|
||||
return "Argument too big";
|
||||
|
||||
case ECHILD:
|
||||
return "No child process";
|
||||
|
||||
case EDEADLK:
|
||||
return "Resource deadlock";
|
||||
|
||||
case EFBIG:
|
||||
return "File too large";
|
||||
|
||||
case EMLINK:
|
||||
return "Too many links";
|
||||
|
||||
case ENODEV:
|
||||
return "No such device";
|
||||
|
||||
case ENOLCK:
|
||||
return "No record locks available";
|
||||
|
||||
case ENOTTY:
|
||||
return "Not a tty";
|
||||
|
||||
case ESRCH:
|
||||
return "No such process";
|
||||
|
||||
case EFPOS:
|
||||
return "File Position Error";
|
||||
|
||||
case ESIGPARM:
|
||||
return "Signal Error";
|
||||
|
||||
case ERANGE:
|
||||
return "Range Error";
|
||||
|
||||
case EPROTOTYPE:
|
||||
return "Protocol wrong type for socket";
|
||||
|
||||
case EPROTONOSUPPORT:
|
||||
return "Protocol not supported";
|
||||
|
||||
case EPFNOSUPPORT:
|
||||
return "Protocol family not supported";
|
||||
|
||||
case EAFNOSUPPORT:
|
||||
return "Address family not supported by protocol family";
|
||||
|
||||
case EADDRINUSE:
|
||||
return "Address already in use";
|
||||
|
||||
case EADDRNOTAVAIL:
|
||||
return "Can't assign requested address";
|
||||
|
||||
case ENETDOWN:
|
||||
return "Network is down";
|
||||
|
||||
case ENETUNREACH:
|
||||
return "Network is unreachable";
|
||||
|
||||
case ENETRESET:
|
||||
return "Network dropped connection on reset";
|
||||
|
||||
case ECONNABORTED:
|
||||
return "Software caused connection abort";
|
||||
|
||||
case ECONNRESET:
|
||||
return "Connection reset by peer";
|
||||
|
||||
case EISCONN:
|
||||
return "Socket is already connected";
|
||||
|
||||
case ENOTCONN:
|
||||
return "Socket is not connected";
|
||||
|
||||
case ESHUTDOWN:
|
||||
return "Can't send after socket shutdown";
|
||||
|
||||
case ECONNREFUSED:
|
||||
return "Connection refused";
|
||||
|
||||
case EHOSTUNREACH:
|
||||
return "No route to host";
|
||||
|
||||
case ENOPROTOOPT:
|
||||
return "Protocol option not available";
|
||||
|
||||
case EINPROGRESS:
|
||||
return "Operation now in progress";
|
||||
|
||||
case EALREADY:
|
||||
return "Operation already in progress";
|
||||
|
||||
case EILSEQ:
|
||||
return "Illegal byte sequence";
|
||||
|
||||
case ENOMSG:
|
||||
return "No message of desired type";
|
||||
|
||||
case ESTALE:
|
||||
return "Stale NFS file handle";
|
||||
|
||||
case EOVERFLOW:
|
||||
return "Value too large for defined type";
|
||||
|
||||
case EMSGSIZE:
|
||||
return "Message too long";
|
||||
|
||||
case EOPNOTSUPP:
|
||||
return "Operation not supported";
|
||||
|
||||
case ENOTSOCK:
|
||||
return "Socket operation on non-socket";
|
||||
|
||||
case B_MAIL_NO_DAEMON:
|
||||
return "No mail daemon";
|
||||
|
||||
case B_MAIL_UNKNOWN_USER:
|
||||
return "Unknown mail user";
|
||||
|
||||
case B_MAIL_WRONG_PASSWORD:
|
||||
return "Wrong password (mail)";
|
||||
|
||||
case B_MAIL_UNKNOWN_HOST:
|
||||
return "Mail unknown host";
|
||||
|
||||
case B_MAIL_ACCESS_ERROR:
|
||||
return "Mail access error";
|
||||
|
||||
case B_MAIL_UNKNOWN_FIELD:
|
||||
return "Unknown mail field";
|
||||
|
||||
case B_MAIL_NO_RECIPIENT:
|
||||
return "No mail recipient";
|
||||
|
||||
case B_MAIL_INVALID_MAIL:
|
||||
return "Invaild mail";
|
||||
|
||||
case B_PRINT_ERROR_BASE:
|
||||
// B_NO_PRINT_SERVER
|
||||
return "No print server";
|
||||
|
||||
case B_DEV_INVALID_IOCTL:
|
||||
return "Invalid device ioctl";
|
||||
|
||||
case B_DEV_NO_MEMORY:
|
||||
return "No device memory";
|
||||
|
||||
case B_DEV_BAD_DRIVE_NUM:
|
||||
return "Bad drive number";
|
||||
|
||||
case B_DEV_NO_MEDIA:
|
||||
return "No media present";
|
||||
|
||||
case B_DEV_UNREADABLE:
|
||||
return "Device unreadable";
|
||||
|
||||
case B_DEV_FORMAT_ERROR:
|
||||
return "Device format error";
|
||||
|
||||
case B_DEV_TIMEOUT:
|
||||
return "Device timeout";
|
||||
|
||||
case B_DEV_RECALIBRATE_ERROR:
|
||||
return "Device recalibrate error";
|
||||
|
||||
case B_DEV_SEEK_ERROR:
|
||||
return "Device seek error";
|
||||
|
||||
case B_DEV_ID_ERROR:
|
||||
return "Device ID error";
|
||||
|
||||
case B_DEV_READ_ERROR:
|
||||
return "Device read error";
|
||||
|
||||
case B_DEV_WRITE_ERROR:
|
||||
return "Device write error";
|
||||
|
||||
case B_DEV_NOT_READY:
|
||||
return "Device not ready";
|
||||
|
||||
case B_DEV_MEDIA_CHANGED:
|
||||
return "Device media changed";
|
||||
|
||||
case B_DEV_MEDIA_CHANGE_REQUESTED:
|
||||
return "Device media change requested";
|
||||
|
||||
case B_DEV_RESOURCE_CONFLICT:
|
||||
return "Resource conflict";
|
||||
|
||||
case B_DEV_CONFIGURATION_ERROR:
|
||||
return "Configuration error";
|
||||
|
||||
case B_DEV_DISABLED_BY_USER:
|
||||
return "Disabled by user";
|
||||
|
||||
case B_DEV_DOOR_OPEN:
|
||||
return "Drive door open";
|
||||
|
||||
case B_NOT_A_MESSAGE:
|
||||
return "Data is not a message";
|
||||
|
||||
default: {
|
||||
static char unknown[28];
|
||||
sprintf(unknown, "Unknown Error (%d)", errnum);
|
||||
return unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user