Skip to content

Commit

Permalink
Merge pull request #12 from hhslepicka/fix-docstring
Browse files Browse the repository at this point in the history
DOC: Fix docstrings for error method.
  • Loading branch information
hhslepicka authored Dec 17, 2022
2 parents a6d4534 + 6021f83 commit b87dead
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 17 deletions.
20 changes: 12 additions & 8 deletions botcity/maestro/impl/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,16 +432,20 @@ def get_artifact(self, artifact_id: int) -> Tuple[str, bytes]:
raise ValueError(message)

def error(self, task_id: int, exception: Exception, screenshot=None, attachments=None, tags=None):
"""
Creates a new artifact
"""Create a new Error entry.
Args:
task_id: The task unique identifier.
name: The name of the artifact to be displayed on the portal.
filename: The file to be uploaded.
Returns:
Server response message. See [ServerMessage][botcity.maestro.model.ServerMessage]
task_id (int): The task unique identifier.
exception (Exception): The exception object.
screenshot (Optional[str], optional): File path for a screenshot to be attached
to the error. Defaults to None.
attachments (Optional[List[str]], optional): Additional files to be sent along
with the error entry. Defaults to None.
tags (Optional[Dict[str, str]], optional): Dictionary with tags to be associated
with the error entry. Defaults to None.
Raises:
ValueError: If the request fails, a ValueError exception is raised.
"""
raise NotImplementedError

Expand Down
23 changes: 14 additions & 9 deletions botcity/maestro/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,17 +292,22 @@ def get_artifact(self, artifact_id: int) -> Tuple[str, bytes]:
@ensure_implementation()
@since_version("2.0.0")
@ensure_access_token()
def error(self, task_id: int, exception: Exception, screenshot=None, attachments=None, tags=None):
"""
Creates a new artifact
def error(self, task_id: int, exception: Exception, screenshot: Optional[str] = None,
attachments: Optional[List[str]] = None, tags: Optional[Dict[str, str]] = None):
"""Create a new Error entry.
Args:
task_id: The task unique identifier.
name: The name of the artifact to be displayed on the portal.
filename: The file to be uploaded.
Returns:
Server response message. See [ServerMessage][botcity.maestro.model.ServerMessage]
task_id (int): The task unique identifier.
exception (Exception): The exception object.
screenshot (Optional[str], optional): File path for a screenshot to be attached
to the error. Defaults to None.
attachments (Optional[List[str]], optional): Additional files to be sent along
with the error entry. Defaults to None.
tags (Optional[Dict[str, str]], optional): Dictionary with tags to be associated
with the error entry. Defaults to None.
Raises:
ValueError: If the request fails, a ValueError exception is raised.
"""
return self._impl.error(task_id, exception, screenshot, attachments, tags)

Expand Down

0 comments on commit b87dead

Please sign in to comment.