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.
Messages are classified into one of the three types, which are indicated by a severity level. Informational messages provide descriptive information concerning things such as a tools progress, start and end times of the tool, output data characteristics, and much more. The severity level of an informational message is indicated by a value of 0
. Warning messages are generated when a problem...