tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nspr_error_handling.rst (7359B)


      1 This chapter describes the functions for retrieving and setting errors
      2 and the error codes set by NSPR.
      3 
      4 -  `Error Type <#Error_Type>`__
      5 -  `Error Functions <#Error_Functions>`__
      6 -  `Error Codes <#Error_Codes>`__
      7 
      8 For information on naming conventions for NSPR types, functions, and
      9 macros, see `NSPR Naming
     10 Conventions <Introduction_to_NSPR#NSPR_Naming_Conventions>`__.
     11 
     12 .. _Error_Type:
     13 
     14 Error Type
     15 ----------
     16 
     17 - :ref:`PRErrorCode`
     18 
     19 .. _Error_Functions:
     20 
     21 Error Functions
     22 ---------------
     23 
     24 - :ref:`PR_SetError`
     25 - :ref:`PR_SetErrorText`
     26 - :ref:`PR_GetError`
     27 - :ref:`PR_GetOSError`
     28 - :ref:`PR_GetErrorTextLength`
     29 - :ref:`PR_GetErrorText`
     30 
     31 .. _Error_Codes:
     32 
     33 Error Codes
     34 -----------
     35 
     36 Error codes defined in ``prerror.h``:
     37 
     38 ``PR_OUT_OF_MEMORY_ERROR``
     39   Insufficient memory to perform request.
     40 ``PR_BAD_DESCRIPTOR_ERROR``
     41   The file descriptor used as an argument in the preceding function is
     42   invalid.
     43 ``PR_WOULD_BLOCK_ERROR``
     44   The operation would have blocked, which conflicts with the semantics
     45   that have been established.
     46 ``PR_ACCESS_FAULT_ERROR``
     47   One of the arguments of the preceding function specified an invalid
     48   memory address.
     49 ``PR_INVALID_METHOD_ERROR``
     50   The preceding function is invalid for the type of file descriptor
     51   used.
     52 ``PR_ILLEGAL_ACCESS_ERROR``
     53   One of the arguments of the preceding function specified an invalid
     54   memory address.
     55 ``PR_UNKNOWN_ERROR``
     56   Some unknown error has occurred.
     57 ``PR_PENDING_INTERRUPT_ERROR``
     58   The operation terminated because another thread has interrupted it
     59   with :ref:`PR_Interrupt`.
     60 ``PR_NOT_IMPLEMENTED_ERROR``
     61   The preceding function has not been implemented.
     62 ``PR_IO_ERROR``
     63   The preceding I/O function encountered some sort of an error, perhaps
     64   an invalid device.
     65 ``PR_IO_TIMEOUT_ERROR``
     66   The I/O operation has not completed in the time specified for the
     67   preceding function.
     68 ``PR_IO_PENDING_ERROR``
     69   An I/O operation has been attempted on a file descriptor that is
     70   currently busy with another operation.
     71 ``PR_DIRECTORY_OPEN_ERROR``
     72   The directory could not be opened.
     73 ``PR_INVALID_ARGUMENT_ERROR``
     74   One or more of the arguments to the function is invalid.
     75 ``PR_ADDRESS_NOT_AVAILABLE_ERROR``
     76   The network address (:ref:`PRNetAddr`) is not available (probably in
     77   use).
     78 ``PR_ADDRESS_NOT_SUPPORTED_ERROR``
     79   The type of network address specified is not supported.
     80 ``PR_IS_CONNECTED_ERROR``
     81   An attempt to connect on an already connected network file
     82   descriptor.
     83 ``PR_BAD_ADDRESS_ERROR``
     84   The network address specified is invalid (as reported by the
     85   network).
     86 ``PR_ADDRESS_IN_USE_ERROR``
     87   Network address specified (:ref:`PRNetAddr`) is in use.
     88 ``PR_CONNECT_REFUSED_ERROR``
     89   The peer has refused to allow the connection to be established.
     90 ``PR_NETWORK_UNREACHABLE_ERROR``
     91   The network address specifies a host that is unreachable (perhaps
     92   temporary).
     93 ``PR_CONNECT_TIMEOUT_ERROR``
     94   The connection attempt did not complete in a reasonable period of
     95   time.
     96 ``PR_NOT_CONNECTED_ERROR``
     97   The preceding function attempted to use connected semantics on a
     98   network file descriptor that was not connected.
     99 ``PR_LOAD_LIBRARY_ERROR``
    100   Failure to load a dynamic library.
    101 ``PR_UNLOAD_LIBRARY_ERROR``
    102   Failure to unload a dynamic library.
    103 ``PR_FIND_SYMBOL_ERROR``
    104   Symbol could not be found in the specified library.
    105 ``PR_INSUFFICIENT_RESOURCES_ERROR``
    106   There are insufficient system resources to process the request.
    107 ``PR_DIRECTORY_LOOKUP_ERROR``
    108   A directory lookup on a network address has failed.
    109 ``PR_TPD_RANGE_ERROR``
    110   Attempt to access a thread-private data index that is out of range of
    111   any index that has been allocated to the process.
    112 ``PR_PROC_DESC_TABLE_FULL_ERROR``
    113   The process' table for holding open file descriptors is full.
    114 ``PR_SYS_DESC_TABLE_FULL_ERROR``
    115   The system's table for holding open file descriptors has been
    116   exceeded.
    117 ``PR_NOT_SOCKET_ERROR``
    118   An attempt to use a non-network file descriptor on a network-only
    119   operation.
    120 ``PR_NOT_TCP_SOCKET_ERROR``
    121   Attempt to perform a TCP specific function on a non-TCP file
    122   descriptor.
    123 ``PR_SOCKET_ADDRESS_IS_BOUND_ERRO``
    124   Attempt to bind an address to a TCP file descriptor that is already
    125   bound.
    126 ``PR_NO_ACCESS_RIGHTS_ERROR``
    127   Calling thread does not have privilege to perform the operation
    128   requested.
    129 ``PR_OPERATION_NOT_SUPPORTED_ERRO``
    130   The requested operation is not supported by the platform.
    131 ``PR_PROTOCOL_NOT_SUPPORTED_ERROR``
    132   The host operating system does not support the protocol requested.
    133 ``PR_REMOTE_FILE_ERROR``
    134   Access to the remote file has been severed.
    135 ``PR_BUFFER_OVERFLOW_ERROR``
    136   The value retrieved is too large to be stored in the buffer provided.
    137 ``PR_CONNECT_RESET_ERROR``
    138   The (TCP) connection has been reset by the peer.
    139 ``PR_RANGE_ERROR``
    140   Unused.
    141 ``PR_DEADLOCK_ERROR``
    142   Performing the requested operation would have caused a deadlock. The
    143   deadlock was avoided.
    144 ``PR_FILE_IS_LOCKED_ERROR``
    145   An attempt to acquire a lock on a file has failed because the file is
    146   already locked.
    147 ``PR_FILE_TOO_BIG_ERROR``
    148   Completing the write or seek operation would have resulted in a file
    149   larger than the system could handle.
    150 ``PR_NO_DEVICE_SPACE_ERROR``
    151   The device for storing the file is full.
    152 ``PR_PIPE_ERROR``
    153   Unused.
    154 ``PR_NO_SEEK_DEVICE_ERROR``
    155   Unused.
    156 ``PR_IS_DIRECTORY_ERROR``
    157   Attempt to perform a normal file operation on a directory.
    158 ``PR_LOOP_ERROR``
    159   Symbolic link loop.
    160 ``PR_NAME_TOO_LONG_ERROR``
    161   Filename is longer than allowed by the host operating system.
    162 ``PR_FILE_NOT_FOUND_ERROR``
    163   The requested file was not found.
    164 ``PR_NOT_DIRECTORY_ERROR``
    165   Attempt to perform directory specific operations on a normal file.
    166 ``PR_READ_ONLY_FILESYSTEM_ERROR``
    167   Attempt to write to a read-only file system.
    168 ``PR_DIRECTORY_NOT_EMPTY_ERROR``
    169   Attempt to delete a directory that is not empty.
    170 ``PR_FILESYSTEM_MOUNTED_ERROR``
    171   Attempt to delete or rename a file object while the file system is
    172   busy.
    173 ``PR_NOT_SAME_DEVICE_ERROR``
    174   Request to rename a file to a file system on another device.
    175 ``PR_DIRECTORY_CORRUPTED_ERROR``
    176   The directory object in the file system is corrupted.
    177 ``PR_FILE_EXISTS_ERROR``
    178   Attempt to create or rename a file when the new name is already being
    179   used.
    180 ``PR_MAX_DIRECTORY_ENTRIES_ERROR``
    181   Attempt to add new filename to directory would exceed the limit
    182   allowed.
    183 ``PR_INVALID_DEVICE_STATE_ERROR``
    184   The device was in an invalid state to complete the desired operation.
    185 ``PR_DEVICE_IS_LOCKED_ERROR``
    186   The device needed to perform the desired request is locked.
    187 ``PR_NO_MORE_FILES_ERROR``
    188   There are no more entries in the directory.
    189 ``PR_END_OF_FILE_ERROR``
    190   Unexpectedly encountered end of file (Mac OS only).
    191 ``PR_FILE_SEEK_ERROR``
    192   An unexpected seek error (Mac OS only).
    193 ``PR_FILE_IS_BUSY_ERROR``
    194   The file is busy and the operation cannot be performed.
    195 ``PR_IN_PROGRESS_ERROR``
    196   The operation is still in progress (probably a nonblocking connect).
    197 ``PR_ALREADY_INITIATED_ERROR``
    198   The (retried) operation has already been initiated (probably a
    199   nonblocking connect).
    200 ``PR_GROUP_EMPTY_ERROR``
    201   The wait group is empty.
    202 ``PR_INVALID_STATE_ERROR``
    203   The attempted operation is on an object that was in an improper state
    204   to perform the request.
    205 ``PR_MAX_ERROR``
    206   Placeholder for the end of the list.