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

fix(fal): inherit all exceptions from FalServerlessException #188

Conversation

efiop
Copy link
Contributor

@efiop efiop commented Apr 23, 2024

This was a little bit more involved before cloudpickle migration, as you had to put @mainify everywhere. Now we can comfortably do that and leverage this in error handling (e.g. see us passing through our own exceptions).

Copy link

linear bot commented Apr 23, 2024

@efiop efiop changed the title fix(fal): inherit all exception from FalServerlessException fix(fal): inherit all exceptions from FalServerlessException Apr 23, 2024
@efiop efiop force-pushed the ruslan/fea-2353-better-error-messages-handle-internal-errors-gracefully branch from 28615eb to deda270 Compare April 23, 2024 13:20
@efiop efiop force-pushed the ruslan/fea-2353-better-error-messages-handle-internal-errors-gracefully branch from deda270 to 534938e Compare April 23, 2024 13:41
Comment on lines -6 to -17

message: str

hint: str | None

def __init__(self, message: str, hint: str | None = None) -> None:
self.message = message
self.hint = hint
super().__init__(message)

def __str__(self) -> str:
return self.message + (f"\nHint: {self.hint}" if self.hint else "")
Copy link
Contributor Author

@efiop efiop Apr 23, 2024

Choose a reason for hiding this comment

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

base exception should as basic as possible (in general, but also because we might have to pickle these) . We don't really need to invent message/hint convention here yet.

@efiop efiop merged commit d338c27 into main Apr 23, 2024
4 of 5 checks passed
@efiop efiop deleted the ruslan/fea-2353-better-error-messages-handle-internal-errors-gracefully branch April 23, 2024 13:50
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.

1 participant