Continue to solve for next iteration even iterative solver cannot converge

Is it possible to make the iterative solver continue to compute rather than output the error message even though it cannot converge. For example, with gmres solver below, even it cannot converge in 2000 iteration, I want the output at the last iteration rather than output the error message. Then I can use the output at the last iteration for the next time step for the transient problem
solver = PETScKrylovSolver(‘gmres’,‘amg’)
#solver.parameters[“nonzero_initial_guess”] = True
#solver.ksp().setGMRESRestart(MAX_ITERS)
solver.set_operators(A_u1, P)
solver.parameters[‘monitor_convergence’] = False
solver.parameters[‘maximum_iterations’] = 2000
solver.parameters[‘relative_tolerance’] =1E-2
solver.parameters[‘absolute_tolerance’] = 1E-4
solver.solve(up1.vector(), b_u1)

It sounds like you’re looking for the following:

from dolfin import *
solver = PETScKrylovSolver("gmres","amg")

# Allow non-convergence without error:
solver.parameters["error_on_nonconvergence"] = False

# Convenient function to list out available options:
info(solver.parameters,True)

Yes, this is what I am looking for. Thanks