Good point, indeed you are right.  get_lexer_by_name throws a pygments.util.ClassNotFound when the given lexer is not found (see http://pygments.org/docs/api/). 

I updated the PR to catch any exception when trying to use pygments, falling back to the straight JSONFormatter if anything exception arise.