Apply patch #5561. Connect debugger on error.