mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2025-07-14 00:13:18 +00:00
Add error handling of invalid CQP queries
This commit is contained in:
app
@ -368,7 +368,7 @@ class CQiClient:
|
||||
self.__send_STRING(mother_corpus)
|
||||
self.__send_STRING(subcorpus_name)
|
||||
self.__send_STRING(query)
|
||||
self.__recv_WORD()
|
||||
self.__recv_response()
|
||||
|
||||
def cqp_list_subcorpora(self, corpus):
|
||||
# INPUT: (STRING corpus)
|
||||
@ -464,6 +464,8 @@ class CQiClient:
|
||||
response = byte_data
|
||||
elif response_type == CQi.ERROR:
|
||||
raise Exception(CQi.lookup[byte_data])
|
||||
elif response_type == CQi.ERROR_SYNTAX_ERROR:
|
||||
raise Exception(CQi.lookup[byte_data])
|
||||
elif response_type == CQi.DATA:
|
||||
response = self.__recv_DATA(byte_data)
|
||||
elif response_type == CQi.CL_ERROR:
|
||||
|
Reference in New Issue
Block a user