Error handling for curl login