Implement gurobi, manage exceptions