Catch any exceptions throw by ping

Ticket: #5427
(cherry picked from commit 6888ee235375e72f953a5f864c9233a3fb9a399a)