Revert "Revert "am2dm connetion error handle""

This reverts commit b4044b8e98653523252cd034c7d3d080b29d0e07.