What is the syntax for the printtask.execute errback?

2778
1
06-22-2016 09:30 PM
AllisterFarn1
New Contributor

I'm writing an angular application that uses the esri map control and a lot of other functionality. I have a printtask that allows a user to print a map with any layers they may have added. I've also allowed them to select pages sizes from A4, A3, A1, A0. When I first started working with this, A1 would timeout. I then set my print service to be Async, and provided the async: true param to the PrintTask constructor. However I find that if the map has a large number of layers and the user selects A0, the service is still timing out with the following error:

{"type":"esriJobMessageTypeInformative","description":"Processing request took longer than the usage timeout for service 'Utilities/PrintingTools.GPServer'."}

I've provided the errback parameter to the call to execute for the printtask, however it isn't invoked. I set a param in the app to indicate a print job is currently underway, however because the error callback isn't called, I'm unable to set this flag.

How do I go about implementing the error callback? I've searched the web and can't find an example that implements this callback. I see in the network tab of the chrome dev tools that the arcgis api is polling the server every second for (i guess) about 5 minutes, and the final message is the failure message.

Below is my current code:

                            printTask.execute(printParameters,

                                function (result) {

                                    $log.debug('Esri portion of print task complete...');

//work with print task output

                                },

                                function(errorResult) {

                                    $log.Info(errorResult);

                                });

Also, where do I configure the "usage timeout" for the print tools service?

Prints larger than A3 can take 3 or 4 minutes - this is on a server with a reasonable spec - is this expected? Is there anything I can do to improve print performance times?

0 Kudos
1 Reply
AllisterFarn1
New Contributor

Can anyone advise how I can get visibility of this question to esri developers who would hopefully know the api? This is not functioning as defined here:

PrintTask | API Reference | ArcGIS API for JavaScript 3.17

However I can't find any documentation or examples of usage of the error callback.