mirror of
https://github.com/Sea-Haven-Industries/afterhours-shift-manager.git
synced 2026-10-06 06:32:04 +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
|
extension = ext if source != "available" else FALLBACK_EXTENSION
|
||||||
|
|
||||||
secret_prefix = os.environ["TCX_SECRET_PREFIX"]
|
secret_prefix = os.environ["TCX_SECRET_PREFIX"]
|
||||||
result = update_queue_routing(
|
try:
|
||||||
extension=extension,
|
result = update_queue_routing(
|
||||||
queue_number=os.environ["QUEUE_NUMBER"],
|
extension=extension,
|
||||||
domain=get_secret(f"{secret_prefix}domain"),
|
queue_number=os.environ["QUEUE_NUMBER"],
|
||||||
client_id=get_secret(f"{secret_prefix}client-id"),
|
domain=get_secret(f"{secret_prefix}domain"),
|
||||||
client_secret=get_secret(f"{secret_prefix}client-secret"),
|
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(
|
result.update(
|
||||||
{
|
{
|
||||||
"date": now.strftime("%Y-%m-%d"),
|
"date": now.strftime("%Y-%m-%d"),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue