acoustic-carpenter-78188
11/05/2025, 11:41 AMerror_code property of the metaclass properly.
Current:
from flytekit.exceptions.user import FlyteUserException
class Example(FlyteUserException):
_ERROR_CODE = "USER:Example"
v = Example()
print(hasattr(v, "error_code")) # False
Proposed:
from flytekit.exceptions.user import FlyteUserException
class Example(FlyteUserException):
_ERROR_CODE = "USER:Example"
v = Example()
print(hasattr(v.class, "error_code")) # True
## How was this patch tested?
Above example
https://bito.ai#summarystart|
### Summary by Bito
• This pull request modifies the accessibility of the error_code property in the FlyteUserException class by changing its access from the instance to the metaclass, ensuring correct retrieval.
• Modifies the retrieval method of the error_code property in the FlyteUserException class to enhance accessibility, resolving an issue with accessibility.
• Updates tests to validate the new behavior of error_code retrieval.
• Improves the overall reliability of error handling in the Flyte framework.
• This change resolves a specific problem where the error_code was not accessible as expected, thus enhancing the reliability of error handling in the Flyte framework.
• Overall summary: touches error handling in the Flyte framework and improves reliability.
flyteorg/flytekitacoustic-carpenter-78188
11/10/2025, 1:43 PM