Skip to content

Conversation

@CharLemAznable
Copy link
Contributor

No description provided.

@hailaz hailaz added the discuss We need discuss to make decision. label Aug 22, 2025
@gqcn
Copy link
Member

gqcn commented Dec 13, 2025

@CharLemAznable To better convey the function's meaning, why not add a new TryCatchFinal function instead?

@gqcn gqcn added the feature label Dec 13, 2025
@CharLemAznable
Copy link
Contributor Author

@CharLemAznable To better convey the function's meaning, why not add a new TryCatchFinal function instead?

@gqcn First, if a new function TryCatchFinal is added to complement the existing TryCatch function, then a corresponding TryFinal function should also be added to complement the Try function. Additionally, new methods may need to be added to gutil_groutine and g_func. In this scenario, there would be a significant amount of redundant code, increasing the burden of future modifications and maintenance.

Another reason is that the optional finally block is a common part of try-catch syntax. If added as an optional parameter to the TryCatch and Try methods, it would not impose a large cognitive burden on most users. Compared to adding optional parameters, introducing new methods represents a more significant API change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discuss We need discuss to make decision. feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants