Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

1.How do I get the http response text & error code from OpenLayers 2.12 WMS loaderror event ?

2.The WMS request returns returns http error code 500 with some response text, however, as per image below, I can't get those details.

3.Workaround: I send a HEAD request in the 'loaderror' handler

                    intramapsConfig = {
                        name : "MapImage WMS",
                        options : { "ratio": 1, "singleTile": true,
                                    "removeBackBufferDelay": 500 ,
                                    "transitionEffect" : "resize",
                                    "tileOptions": {
                                    "eventListeners": {
                                            'loaderror': function(evt) {
                                                console.log('loaderror');
                                                debugger;
                                                $.ajax({
                                                    type: "HEAD",
                                                    async: false,
                                                    url: evt.object.url,
                                                    success: function(message,text,response){
                                                        debugger;
                                                    },
                                                    error: function(error) {
                                                        debugger;
                                                    }
                                                });

                                            }
                                        }
                                }
                        }

4.The image below is the event object sent by onImageError function.

enter image description here

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.