Could be kennel cough, they hack and hack like they are trying to throw up but rarely do. Now you say it did throw up some bile so that makes you wonder. I would also say check to see if anything stuck in his teeth or throat, a twig or anything can cause that choking but again the bile doesn’t fit with that scenario. Did you take his temp? Should be around 101.5 to 102.5, color of gum and tongue should be pinkish. If you prod his gum with your thumb nail, will whiten and then turn pink again, check for dehydration by picking up loose skin, does it snap back? All things to check to decide how serious it is. Pups often eat stuff, throw up and then go on their way.