The how to do it right is important because WebGL adoption is growing, and plenty of sites actually require it, as opposed to only having a tangential demo or fancy logo on it that isn't strictly necessary. If your site absolutely requires WebGL, and you block browsers incorrectly, you're hurting your site drastically.
I don't know what the best way to do it is, and I'd love to hear what other people do. My current thinking is: don't screw around with user agents, of course. This might be where the OP's complaint came from, because if you try to whitelist compatible browsers, new ones will always break immediately.
A better approach is put a canvas on your page, try to grab the webgl context, and check whether it failed. That way, if webgl can work, it will, and you only block people who have it turned off or actually have on old browser.
The message that announces the reason for failure is important, IMO. You can put up some explanation for how to fix the problem, because sometimes its fixable, or you can do something off-putting that only says 'fail' and chase people away.