Return error messages from python script to geprocessing task

4895
4
10-06-2010 08:13 AM
BradleyMontgomery
New Contributor II
I have a script tool in a toolbox that I use in a geoprocessing service. The script tool takes in a couple of parameters, runs a python script and returns some parameters back to the flex application that called the tool through the geoprocessing service. Sometimes the python script will error for whatever reasons. I'd like to be able to return the python error message back to the flex application. As of now, when the script errors, I get the generic error type 500 - error executing function error message.

I call the tool this way:

gp.execute(params, new AsyncResponder(getResultFunc, onFault));

The onFault routine does this:

private function onFault(info:Object, token:Object = null):void
{
       Alert.show("General error \n\n" + info.toString());
}

How do I get the python error message to the onFault function? I'm sure that I need to set a parameter to return from the script and then somehow receive that parameter in the onFault function but I don't know the details.

Thanks!
Tags (2)
0 Kudos
4 Replies
GaryBushek
New Contributor III
having the same problem where a script occasionaly fails with this error message. Did you ever figure this out?

thanks
0 Kudos
ErikMartin
Occasional Contributor
I'd also like to be able to have messages from arcpy.AddMessage (error and other) show up in my Flex viewer... Did you ever sort this out?
0 Kudos
deleted-user-mezzanRtr2IZ
New Contributor III

This thread is fairly old but this problem persists. I have been trying to find a way to pass esriJobMessageTypeError to the output message box the user receives once a gp script fails.  I can see the errors returned using the browser's built in developer tools, but most of my users will not know how to use access these messages.  I read that flex Viewer 3.7 was supposed to have enhanced error reporting for the gp widget, but I don't see any enhancement from previous versions or a way to enable them.  I have looked at implementing GPMessage into the uncompiled geoprocessing.mxml but need a little guidance as to how to do this correctly.  Bjorn SvenssonRobert Scheitlin​  Any advice or links to solutions out there?  Thanks.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Jeff,

  I don't even touch Flex anymore so sorry I do not know.

0 Kudos