Ns Error Not Initialized
Contents |
References & Guides Learning web development Tutorials References Developer Guides Accessibility Game development ...more docs Mozilla Docs Add-ons Firefox Developer
Ns_imagelib_error_failure
ToolsFeedback Get Firefox help Get web development help Join the MDN community getzoneattributes failed: 80004003 Report a content problem Report a bug Search Search Languages No translations exist for this article.
Xmlhttprequest Ns_error_not_initialized
Add a translation Edit Advanced Advanced History Print this article MDN Mozilla Error codes returned by Mozilla APIs Your Search Results zephyrus00jp Sheppy mattflaschen kscarfone BenB trevorh MatrixFrog aurelien.requiem firefox ns_error_failure JohnST Brettz9 Souqueta Nickolay Waldo Enn Error codes returned by Mozilla APIs The following tables list errors that can occur when calling various Mozilla APIs. Each error is listed by its name and an error code in parentheses. An error will typically be displayed on the error console, but can be captured using a try-catch block in JavaScript. These constants can be accessed through Components.results. For example, by using Components.results.NS_ERROR_NOT_INITIALIZED General Errors The following errors are general and can occur when using any component. NS_ERROR_NOT_INITIALIZED (0xC1F30001) An attempt was made to use a component or object which has not yet been initialized. These components usually provide an initialization method, often called Init, which must be called before other methods are used. NS_ERROR_ALREADY_INITIALIZED (0xC1F30002) An attempt is made to initialize a component or object again which has already been initialized. NS_ERROR_NOT_IMPLEMENTED (0x80004001) This error is caused by methods which are not implemented. This could occur because the implementation has not yet been written, or because the component intentionally does not support the desired feature. NS_ERROR_NO_INTERFACE (0x80004002) An attempt was made to call QueryInterface to retrieve an interface which an object does not support. NS_ERROR_NULL_POINTER (0x80004003) An error occurred because a value was set to null when this was not expected. NS_ERROR_ABORT (0x80004004) This error indicates that an operation failed and the caller should abort whatever action is being perf
"Component returned failure code:0xc1f30001 .... )And I have found another solution:Do NOT call "this._object.send(vData);"if "this._object.abort();" has been called (see XMLHttpRequest.js).-----------------------Look at Request.js:window.setTimeout(function(){if (request._aborted !== true) {request.send(config.data);}}, 0);and look at XMLHttpRequest.js :cXMLHttpRequest.prototype.send = function(vData) {// Add method snifferif (cXMLHttpRequest.onsend)....and look at XMLHttpRequest.js:cXMLHttpRequest.prototype.abort = function() {....// BUGFIX: Gecko - unnecessary DONE when abortingif (this.readyState > cXMLHttpRequest.UNSENT)this._aborted = true;this._object.abort();....-----------------------I have added to XMLHttpRequest.js these lines and the problem was solved:cXMLHttpRequest.prototype.send https://developer.mozilla.org/en-US/docs/Mozilla/Errors = function(vData) {if (!!this._isAbortCalled)return;....cXMLHttpRequest.prototype.abort = function() {this._isAbortCalled = true;....---------------------I.e.try { this._object.send(vData); } catch (e) {}looks like a workaround.What do you think?Could you check my changes on your system if it solves your problem?--View this message in context: http://osgeo-org.1803224.n2.nabble.com/SOLVED-Firefox-nsIXMLHttpRequest-send-throwing-0xc1f30001-NS-ERROR-NOT-INITIALIZED-tp5903108p6349420.htmlSent from the OpenLayers Users mailing list archive at Nabble.com. http://openlayers-users.osgeo.narkive.com/jRidknIG/re-solved-firefox-nsixmlhttprequest-send-throwing-0xc1f30001-ns-error-not-initialized Eric Lemoine 2011-05-11 05:07:28 UTC PermalinkRaw Message Post by flexer0xc1f30001 .... )Do NOT call "this._object.send(vData);"if "this._object.abort();" has been called (see XMLHttpRequest.js).----------------------- window.setTimeout(function(){ if (request._aborted !== true) { request.send(config.data); } }, 0); cXMLHttpRequest.prototype.send = function(vData) { // Add method sniffer if (cXMLHttpRequest.onsend) .... cXMLHttpRequest.prototype.abort = function() { .... // BUGFIX: Gecko - unnecessary DONE when aborting if (this.readyState > cXMLHttpRequest.UNSENT) this._aborted = true; this._object.abort(); ....----------------------- cXMLHttpRequest.prototype.send = function(vData) { if (!!this._isAbortCalled) return; .... cXMLHttpRequest.prototype.abort = function() {
your question and get tips & solutions from a community of https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ErrorHandlingCocoa/CreateCustomizeNSError/CreateCustomizeNSError.html 418,602 IT Pros & Developers. It's quick & easy. Ns_error_not_initialized P: 5 dcostalis Yes. another one. ns error This is not my first httprequest site, but it is only my second. I didn't have any issues the first run through. the error produced is: Expand|Select|Wrap|Line Numbers Error:uncaughtexception: [Exception..."Componentreturnedfailurecode:0xc1f30001(NS_ERROR_NOT_INITIALIZED)[nsIXMLHttpRequest.send]"nsresult:"0xc1f30001(NS_ERROR_NOT_INITIALIZED)"location:"JSframe::http://whathuhstudios.com/westside_dev/::sndReq::line32"data:no] here is ns error not the code that is being excecuted. The startajax() runs from an onclick Expand|Select|Wrap|Line Numbers varbrowser=navigator.appName; functionstartajax() { sndReq(document.getElementById('catagorylist').value,'providerlist.php','test'); } functioncreateRequestObject(){ varro; if(browser=="MicrosoftInternetExplorer"){ ro=newActiveXObject("Microsoft.XMLHTTP"); }else{ ro=newXMLHttpRequest(); } returnro; } varhttp=createRequestObject(); functionsndReq(request,ajax_file,targeturi){ varrequesturi='ajax/'+ajax_file; document.getElementById(targeturi).innerHTML=requesturi; http.onreadystatechange=newFunction(handleResponse(targeturi)); http.send(null); } functionhandleResponse(targeturi){ if(http.readyState==4){ varresponse=http.responseText; document.getElementById(targeturi).innerHTML=response; } } Feb 22 '07 #1 Post Reply Share this Question 4 Replies Expert Mod 15k+ P: 16,027 acoder Never use browser detection, always use object detection. Use something similar to the following instead: Expand|Select|Wrap|Line Numbers functionGetXmlHttpObject(){ varxmlhttp; if(window.XMLHttpRequest){//Mozilla,Safari,Opera... xmlhttp=newXMLHttpRequest(); //if(xmlhttp.overrideMimeType)xmlhttp.overrideMimeType('text/xml'); }elseif(window.ActiveXObject){//IE try{ xmlhttp=newActiveXObject("Msxml2.XMLHTTP"); }catch(e){ try{ xmlhttp=newActiveXObject("Microsoft.XMLHTTP"); }catch(e){} } } if(!xmlhttp){ alert('CannotcreateanXMLHTTPinstance'); returnf
describe how to deal with NSError objects returned from framework methods, how to display error messages using error objects, how to create error objects, and how to implement methods that return error objects by reference. Handling Error Objects Returned From MethodsMany methods of the Cocoa and Cocoa Touch classes include as their last parameter a direct or indirect reference to an NSError object. In some Foundation and UIKit methods you find NSError objects as arguments of delegation methods. The following declaration is from the UIKit framework’s UIWebViewDelegate protocol; a delegate would implement a method such as this to find out if an operation failed:- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error;Some methods of the Cocoa frameworks that you call include an indirect reference to an NSError object; these methods typically perform an operation such as creating a document, writing a file, or loading a URL. For example, the following method declaration is from the NSDocument class header file:- (BOOL)writeToURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError;If a method such as this encounters an error in its implementation, it directly returns NO to indicate failure and indirectly returns (if the client code requests it) an NSError object in the last parameter to describe the error.If you want to evaluate the error, declare an NSError object variable before calling a method such as writeToURL:ofType:error:. When you invoke the method, pass in a pointer to this variable. (If you are not interested in the error, just pass NULL.) If the method directly returns nil or NO, inspect the NSError object to determine the cause of the error or simply display an error alert. Listing 2-1 illustrates this