Ian
04/13/2023, 5:17 PMtry:
DeltaTable(str(delta_path))
return True
except PyDeltaTableError:
raise NotFoundException(f'Delta Table not found: delta_table_path={delta_path}')
# app_logger.error(f'Delta Table not found: delta_table_path={delta_path}')
# return False
except Exception as e:
app_logger.error(e)
return False
Will Jones
04/13/2023, 5:33 PMIan
04/13/2023, 5:49 PMWill Jones
04/13/2023, 5:56 PMPyDeltaTableError
exception?PyDeltaTableError
to a 500 server error?Ian
04/13/2023, 6:03 PMPyDeltaTableError
is thrown when you give an invalid path to a deltaTable instance. In my above code when i try to use expect block on it will automatically throw 500 response without even looking at any return statements but if I raise another exception inside the block i am able to counter the behaviour and log what’s written in my hardcoded exception.
Thing is I dont want to do that but handle PyDeltaTableError so wen the control reaches there it returns me just false rather than 500 errorWill Jones
04/13/2023, 6:09 PMIan
04/13/2023, 6:12 PM