Fix debug output for Api* connection errors.

Refs #6070