Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CT-1024] chore: update error endpoint #104

Merged
merged 4 commits into from
May 24, 2024

Conversation

Anne-ClaireFouchier
Copy link
Contributor

  • Remove error method for redact_request v4
  • Change redact_job get_error() to return status error message

* Remove error method for redact_request v4
* Change redact_job get_error() to return status error message
@Anne-ClaireFouchier
Copy link
Contributor Author

Anne-ClaireFouchier commented May 17, 2024

Before the change, this is what calling get_error would return :

Traceback (most recent call last):
  File "/Users/anne-clairefouchier/debug/debug.py", line 34, in <module>
    main()
  File "/Users/anne-clairefouchier/debug/debug.py", line 23, in main
    print(f"error : {job.get_error()}")
  File "/Users/anne-clairefouchier/opt/miniconda3/lib/python3.9/site-packages/redact/v4/redact_job.py", line 63, in get_error
    return self.redact.get_error(
  File "/Users/anne-clairefouchier/opt/miniconda3/lib/python3.9/site-packages/redact/v4/redact_requests.py", line 289, in get_error
    raise RedactResponseError(response=response, msg="Error getting job error")
redact.errors.RedactResponseError: <Response [404 NOT FOUND]> Error getting job error

Now, we return a dictionary, as of example:

{'error': 'An unknown error has occurred. Please contact Brighter AI for support.'}

@Anne-ClaireFouchier Anne-ClaireFouchier merged commit 600cec9 into main May 24, 2024
11 checks passed
@Anne-ClaireFouchier Anne-ClaireFouchier deleted the CT-1024-v4-error-retrieval branch May 24, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants