ExecuteError (arcpy)

Zusammenfassung

The ExecuteError exception class is raised whenever a geoprocessing tool encounters an error.

Codebeispiel

ExecuteError exception example

The ExecuteError class is used below to specifically handle any geoprocessing tool errors that result from CopyFeatures.

import arcpy

inFeatures = "c:/base/transport.gdb/roads"

try:
    # CopyFeatures will always fail if the input and output are the same feature class
    #
    arcpy.CopyFeatures_management(inFeatures, inFeatures)

except arcpy.ExecuteError:
    print arcpy.GetMessages()

Verwandte Themen

9/11/2013