Skip to content

Commit

Permalink
Replace logging exceptions with warnings as error trace not required.
Browse files Browse the repository at this point in the history
  • Loading branch information
BennyThadikaran committed Apr 27, 2024
1 parent e9f7282 commit aed2ef3
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/defs/defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def getHolidayList(nse: NSE):
try:
data = nse.holidays(type=nse.HOLIDAY_TRADING)
except Exception as e:
logger.exception("Failed to download holidays", exc_info=e)
logger.warning(f"Failed to download holidays - {e}")
exit()

# CM pertains to capital market or equity holidays
Expand Down Expand Up @@ -196,9 +196,7 @@ def validateNseActionsFile(nse: NSE):
to_date=dates.dt + timedelta(8),
)
except Exception as e:
logger.exception(
"Failed to download {action} actions", exc_info=e
)
logger.warning(f"Failed to download {action} actions - {e}")
exit()

meta[f"{action}ActionsExpiry"] = (
Expand All @@ -221,9 +219,7 @@ def validateNseActionsFile(nse: NSE):
to_date=expiryDate + timedelta(8),
)
except Exception as e:
logger.exception(
f"Failed to update {action} actions", exc_info=e
)
logger.warning(f"Failed to update {action} actions - {e}")
exit()

meta[f"{action}ActionsExpiry"] = newExpiry
Expand Down Expand Up @@ -345,7 +341,7 @@ def updateAmiBrokerRecords(nse: NSE):
except (RuntimeError, FileNotFoundError):
continue
except ChunkedEncodingError as e:
logger.exception("Please try again.", exc_info=e)
logger.warning(f"{e} - Please try again.")
exit()

toAmiBrokerFormat(bhavFile)
Expand Down

0 comments on commit aed2ef3

Please sign in to comment.