Filter Content By
Version
Text Search
Error handling
Errors in the Gurobi Python interface are handled through the Python exception mechanism. In the example, all Gurobi statements are enclosed inside atry
block, and any associated errors would be caught by theexcept
block:
except gp.GurobiError as e: print('Error code ' + str(e.errno) + ': ' + str(e)) except AttributeError: print('Encountered an attribute error')