Open
Conversation
Author
|
oops - I should read existing PR's first :o |
CCob
reviewed
Jul 21, 2024
| key = Helpers.StringToByteArray(arguments["/keyhex"]); | ||
| try | ||
| { | ||
| key = Helpers.StringToByteArray(arguments["/keyhex"]); |
Contributor
There was a problem hiding this comment.
Instead of putting the try/catch around the single function call, would it not be cleaner to have a higher level try block in Main for ArgumentException?
CCob
reviewed
Jul 21, 2024
| { | ||
| try | ||
| { | ||
| hashBytes = Helpers.StringToByteArray(hash); |
Contributor
There was a problem hiding this comment.
See previous comments regarding propagating the exception and catching higher up in Main
CCob
reviewed
Jul 21, 2024
| { | ||
| try | ||
| { | ||
| hashBytes = Helpers.StringToByteArray(hash); |
Contributor
|
Thanks for the PR an sorry for the delay. Finally had some time to look at this. I've added some comments to the PR. I think throwing an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running from something like 'execute-assembly', Environment.Exit can be problematic.
In my code I had something like the following in place: https://www.mdsec.co.uk/2020/08/massaging-your-clr-preventing-environment-exit-in-in-process-net-assemblies/
But you can imagine that when Environment.Exit is used to break an infinite loop, this will get interesting 😄 In this case the monitor action became an infinite loop until negative time remaining gave exceptions.
There are some more uses of Environment.Exit() but they seem less problematic (need to be careful with correct parameters though).