[CS] Proper error handling when looking up grammars by URI