Prolog LanguageError handling and exceptions