Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
NEC-Vishal committed Dec 29, 2022
1 parent 493de16 commit df2f690
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/translators/sql_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import dateutil.parser
from typing import Any, List, Optional, Sequence
from uuid import uuid4
import crate

from cache.factory import get_cache, is_cache_available
from translators.insert_splitter import to_insert_batches
Expand Down Expand Up @@ -1122,10 +1123,14 @@ def query(self,
try:
self.cursor.execute(op)

except crate.client.exceptions.ProgrammingError as e:
err_msg = self.sql_error_handler(e)
self.logger.error(str(e),exc_info=True)
entities = []
if err_msg:
message = err_msg

except Exception as e:
# TODO due to this except in case of sql errors,
# all goes fine, and users gets 404 as result
# Reason 1: fiware_service_path column in legacy dbs.
err_msg = self.sql_error_handler(e)
self.logger.error(str(e), exc_info=True)
entities = []
Expand Down

0 comments on commit df2f690

Please sign in to comment.