8000 Prefix server errors with `Cog:` by meatballhat · Pull Request #1980 · replicate/cog · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Prefix server errors with Cog: #1980

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

Merged
merged 3 commits into from
Oct 9, 2024
Merged

Prefix server errors with Cog: #1980

merged 3 commits into from
Oct 9, 2024

Conversation

meatballhat
Copy link
Contributor

to allow for separation of error tracking.

Connected to internal issue PLAT-265

to allow for separation of error tracking.

Connected to internal issue PLAT-265
@meatballhat meatballhat requested a review from a team October 8, 2024 19:19
nickstenning
< 8000 div class="ml-md-2 mt-md-0 mt-2 flex-shrink-0"> View reviewed changes
Copy link
Contributor
@nickstenning nickstenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These error messages can and will be seen by users, so I think we should probably avoid the word "internal." Maybe just Cog:?

What do you think about using a custom user exception type rather than a constant? Something like:

class CogException(Exception):
     def __str__(self):
         return f"Cog: {super().__str__()}"

If we did that I'd imagine stuff like UnknownPredictionError, RunnerBusyError, etc. all become subclasses of CogError.

The only slightly tricksy one is likely the TimeoutError for which we could probably get by with:

class CogTimeoutError(CogException, TimeoutError):
    pass

@meatballhat
Copy link
Contributor Author

@nickstenning I would much prefer a custom exception class 🎉

@meatballhat meatballhat changed the title Prefix internal errors with cog-internal: Prefix server errors with Cog: Oct 8, 2024
@meatballhat meatballhat requested a review from a team October 9, 2024 15:12
Copy link
Contributor
@nickstenning nickstenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@meatballhat meatballhat merged commit 135599f into main Oct 9, 2024
15 checks passed
@meatballhat meatballhat deleted the internal-error-prefix branch October 9, 2024 15:17
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
0