mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-09-30 06:43:12 +00:00
Add error handling to ring scheduler 3CX call
This commit is contained in:
parent
dbaf99df49
commit
eb8f397b9e
1 changed files with 12 additions and 7 deletions
|
|
@ -55,13 +55,18 @@ def handler(event, context):
|
|||
extension = ext if source != "available" else FALLBACK_EXTENSION
|
||||
|
||||
secret_prefix = os.environ["TCX_SECRET_PREFIX"]
|
||||
result = update_queue_routing(
|
||||
extension=extension,
|
||||
queue_number=os.environ["QUEUE_NUMBER"],
|
||||
domain=get_secret(f"{secret_prefix}domain"),
|
||||
client_id=get_secret(f"{secret_prefix}client-id"),
|
||||
client_secret=get_secret(f"{secret_prefix}client-secret"),
|
||||
)
|
||||
try:
|
||||
result = update_queue_routing(
|
||||
extension=extension,
|
||||
queue_number=os.environ["QUEUE_NUMBER"],
|
||||
domain=get_secret(f"{secret_prefix}domain"),
|
||||
client_id=get_secret(f"{secret_prefix}client-id"),
|
||||
client_secret=get_secret(f"{secret_prefix}client-secret"),
|
||||
)
|
||||
except Exception:
|
||||
logger.exception("Failed to update 3CX queue routing")
|
||||
return {"error": True, "date": now.strftime("%Y-%m-%d"), "day": day_name}
|
||||
|
||||
result.update(
|
||||
{
|
||||
"date": now.strftime("%Y-%m-%d"),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue