Skip to content

Commit

Permalink
Merge pull request #1113 from RasaHQ/ATO-2564-Change-missing-domain-l…
Browse files Browse the repository at this point in the history
…og-level-in-rasa-sdk-from-ERROR-to-DEBUG

Change missing domain log level in rasa-sdk from ERROR to DEBUG
  • Loading branch information
aleksandarmijat authored Jun 27, 2024
2 parents bb4ba0d + 8686cfe commit 8c41dea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog/1113.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Changed log message level from `error` to `debug`.
- Rephrased the log message to precisely describe that the request is being retried if the domain context is missing.
- Referenced this behavior in the documentation.
2 changes: 1 addition & 1 deletion rasa_sdk/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def webhook(request: Request) -> HTTPResponse:
body = {"error": e.message, "action_name": e.action_name}
return response.json(body, status=404)
except ActionMissingDomainException as e:
logger.error(e)
logger.debug(e)
body = {"error": e.message, "action_name": e.action_name}
return response.json(body, status=449)

Expand Down
7 changes: 6 additions & 1 deletion rasa_sdk/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,12 @@ class ActionMissingDomainException(Exception):

def __init__(self, action_name: Text, message: Optional[Text] = None) -> None:
self.action_name = action_name
self.message = message or "Domain context is missing."
self.message = (
message
or "Missing domain context, assistant will retry the request and include "
"the domain in the request payload. For more information please see "
"https://rasa.com/docs/rasa-pro/action-server/"
)

def __str__(self) -> Text:
return self.message

0 comments on commit 8c41dea

Please sign in to comment.