O'Reilly logo

Programming ArcGIS 10.1 with Python Cookbook by Eric Pimpler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Filtering tool messages by severity level

As I mentioned in the last recipe, all tools generate a number of messages that can be classified as information, warning, or error messages. The GetMessages() method accepts a parameter that allows you to filter the messages that are returned. For example, you may not be interested in the informative or warning messages in your script. However, you are certainly interested in error messages as they indicate a fatal error that will not allow a tool to successfully execute. Using GetMessages(), you can filter the returned message to only error messages.

Getting ready

Messages are classified into one of the three types, which are indicated by a severity level. Informational messages provide descriptive information ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required