Back to index

lightning-sunbird  0.9+nobinonly
nsNetError.h
Go to the documentation of this file.
00001 /* ***** BEGIN LICENSE BLOCK *****
00002  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00003  *
00004  * The contents of this file are subject to the Mozilla Public License Version
00005  * 1.1 (the "License"); you may not use this file except in compliance with
00006  * the License. You may obtain a copy of the License at
00007  * http://www.mozilla.org/MPL/
00008  *
00009  * Software distributed under the License is distributed on an "AS IS" basis,
00010  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00011  * for the specific language governing rights and limitations under the
00012  * License.
00013  *
00014  * The Original Code is Mozilla.
00015  *
00016  * The Initial Developer of the Original Code is
00017  * Netscape Communications Corporation.
00018  * Portions created by the Initial Developer are Copyright (C) 2002
00019  * the Initial Developer. All Rights Reserved.
00020  *
00021  * Contributor(s):
00022  *   Darin Fisher <darin@netscape.com> (original author)
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef nsNetError_h__
00039 #define nsNetError_h__
00040 
00041 #include "nsError.h"
00042 
00043 
00044 /* NETWORKING ERROR CODES */
00045 
00046 
00047 /******************************************************************************
00048  * General async request error codes:
00049  * 
00050  * These error codes are commonly passed through callback methods to indicate
00051  * the status of some requested async request.
00052  *
00053  * For example, see nsIRequestObserver::onStopRequest.
00054  */
00055 
00059 #define NS_BINDING_SUCCEEDED \
00060     NS_OK
00061 
00065 #define NS_BINDING_FAILED \
00066     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 1)
00067 
00071 #define NS_BINDING_ABORTED \
00072     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 2)
00073 
00081 #define NS_BINDING_REDIRECTED \
00082     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 3)
00083 
00091 #define NS_BINDING_RETARGETED \
00092     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 4)
00093 
00094 
00095 /******************************************************************************
00096  * Miscellaneous error codes:
00097  *
00098  * These errors are not typically passed via onStopRequest.
00099  */
00100 
00104 #define NS_ERROR_MALFORMED_URI \
00105     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 10)
00106 
00110 #define NS_ERROR_UNKNOWN_PROTOCOL \
00111     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 18)
00112 
00121 #define NS_ERROR_NO_CONTENT \
00122     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 17)
00123 
00130 #define NS_ERROR_IN_PROGRESS \
00131     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 15)
00132 
00133 
00134 /******************************************************************************
00135  * Connectivity error codes:
00136  */
00137 
00142 #define NS_ERROR_ALREADY_CONNECTED \
00143     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 11)
00144 
00149 #define NS_ERROR_NOT_CONNECTED \
00150     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 12)
00151 
00156 #define NS_ERROR_CONNECTION_REFUSED \
00157     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 13)
00158 
00162 #define NS_ERROR_PROXY_CONNECTION_REFUSED \
00163     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 72)
00164 
00168 #define NS_ERROR_NET_TIMEOUT \
00169     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 14)
00170 
00175 #define NS_ERROR_OFFLINE \
00176     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 16)
00177 
00183 #define NS_ERROR_PORT_ACCESS_NOT_ALLOWED \
00184     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 19)
00185 
00189 #define NS_ERROR_NET_RESET \
00190     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 20)
00191 
00195 #define NS_ERROR_NET_INTERRUPT \
00196     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 71)
00197 
00198 // XXX really need to better rationalize these error codes.  are consumers of
00199 //     necko really expected to know how to discern the meaning of these??
00200 
00201 
00206 #define NS_ERROR_NOT_RESUMABLE \
00207     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 25)
00208 
00213 #define NS_ERROR_ENTITY_CHANGED \
00214     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 32)
00215 
00219 #define NS_ERROR_REDIRECT_LOOP \
00220     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 31)
00221 
00227 #define NS_ERROR_UNSAFE_CONTENT_TYPE \
00228     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 74)
00229 
00230 /******************************************************************************
00231  * FTP specific error codes:
00232  *
00233  * XXX document me
00234  */
00235 
00236 #define NS_ERROR_FTP_LOGIN \
00237     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 21)
00238 
00239 #define NS_ERROR_FTP_CWD \
00240     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 22)
00241 
00242 #define NS_ERROR_FTP_PASV \
00243     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 23)
00244 
00245 #define NS_ERROR_FTP_PWD \
00246     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 24)
00247 
00248 #define NS_ERROR_FTP_LIST \
00249     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 25)
00250 
00251 /******************************************************************************
00252  * DNS specific error codes:
00253  */
00254 
00259 #define NS_ERROR_UNKNOWN_HOST \
00260     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 30)
00261 
00268 #define NS_ERROR_UNKNOWN_PROXY_HOST \
00269     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 42)
00270 
00271 
00272 /******************************************************************************
00273  * Socket specific error codes:
00274  */
00275 
00279 #define NS_ERROR_UNKNOWN_SOCKET_TYPE \
00280     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 51)
00281 
00285 #define NS_ERROR_SOCKET_CREATE_FAILED \
00286     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 52)
00287 
00288 
00289 /******************************************************************************
00290  * Cache specific error codes:
00291  *
00292  * XXX document me
00293  */
00294 
00295 #define NS_ERROR_CACHE_KEY_NOT_FOUND \
00296     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 61)
00297 
00298 #define NS_ERROR_CACHE_DATA_IS_STREAM \
00299     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 62)
00300 
00301 #define NS_ERROR_CACHE_DATA_IS_NOT_STREAM \
00302     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 63)
00303 
00304 #define NS_ERROR_CACHE_WAIT_FOR_VALIDATION \
00305     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 64)
00306 
00307 #define NS_ERROR_CACHE_ENTRY_DOOMED \
00308     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 65)
00309 
00310 #define NS_ERROR_CACHE_READ_ACCESS_DENIED \
00311     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 66)
00312 
00313 #define NS_ERROR_CACHE_WRITE_ACCESS_DENIED \
00314     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 67)
00315 
00316 #define NS_ERROR_CACHE_IN_USE \
00317     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 68)
00318 
00323 #define NS_ERROR_DOCUMENT_NOT_CACHED \
00324     NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 70)
00325 
00326 
00327 #endif // !nsNetError_h__