more dynamic error checking for CURL exception message