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

Reflection_Engine: RunExtensionMethod and Try #692

Closed
IsakNaslundBh opened this issue Dec 3, 2018 · 2 comments
Closed

Reflection_Engine: RunExtensionMethod and Try #692

IsakNaslundBh opened this issue Dec 3, 2018 · 2 comments
Assignees
Labels
severity:medium Slows progress, but workaround is possible type:feature New capability or enhancement type:question Ask for further details or start conversation

Comments

@IsakNaslundBh
Copy link
Contributor

IsakNaslundBh commented Dec 3, 2018

Could be useful to have two methods for this:

  1. TryRunExtensionMethod. Would do what the current one does. Tries to find the method, if it finds it Runs it, otherwise returns null. No warnings/errors/Exceptions.
  2. RunExtensionMethod. Named as the current, but throwing exception/raising error if the method is not found.

To put into some context, @pawelbaran found a case where it was useful to use the RunExtensionMethod and take different actions depending if it returned a null or not. Given the method name, it does not feel like it should be used as a "null check" but be a bit more agressive if the method could not be found, either recording an error or potentionally even throwing an exception. Still this pattern might be useful, and with a slightly different name, TryRunExtensionMethod, it feels like it could be ok.

@BHoM BHoM deleted a comment from IsakNaslundBh Dec 21, 2018
@al-fisher al-fisher added severity:medium Slows progress, but workaround is possible type:feature New capability or enhancement type:question Ask for further details or start conversation and removed feature labels Mar 20, 2019
@adecler adecler assigned IsakNaslundBh and unassigned adecler Sep 10, 2020
@adecler
Copy link
Member

adecler commented Sep 10, 2020

@IsakNaslundBh , is that still an issue ?

@FraserGreenroyd
Copy link
Contributor

As we do now have a TryRunExtensionMethod in addition to RunExtensionMethod, I'm closing this issue as completed 😄 @IsakNaslundBh please feel free to reopen if you disagree!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity:medium Slows progress, but workaround is possible type:feature New capability or enhancement type:question Ask for further details or start conversation
Projects
None yet
Development

No branches or pull requests

4 participants