<#3349 Check and access metaclass error_code prope...
# flyte-github
a
#3349 Check and access metaclass error_code property properly Pull request opened by andresgomezfrr ## Tracking issue Closes flyteorg/flyte#6719 ## Why are the changes needed? The changes are needed to validate and access the
error_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/flytekit