Skip to content

Conversation

@Lestropie
Copy link
Member

If path to output weights file is erroneous, do not issue a misleading warning message claiming that the issue relates to an inability to allocate memory.

Fixes bug introduced in #626.
Solves #2668.
Replaces #2671.


Classic case of why you should not catch exceptions in a manner that is broad in both scope of exception type and length of code.

Note that even though the output weights vector is the primary output of the tcksift2 command, there was nevertheless a conscious decision in the past to nevertheless allow the rest of the command to complete even if there were a memory failure at this point. There might be other outputs that could be of use. Or for instance, the user may have requested that the streamline weighting coefficients be exported, which don't require allocation of additional memory to write, and the weighting factors can be computed from those after the fact.

If path to output weights file is erroneous, do not issue a misleading warning message claiming that the issue relates to an inability to allocate memory.
Fixes bug introduced in #626.
Solves #2668.
Replaces #2671.
@Lestropie Lestropie added the bug label Jul 4, 2023
@Lestropie Lestropie requested a review from a team July 4, 2023 01:36
@Lestropie Lestropie self-assigned this Jul 4, 2023
@jdtournier jdtournier added this pull request to the merge queue Jul 4, 2023
Merged via the queue into master with commit 8a19272 Jul 4, 2023
@jdtournier jdtournier deleted the tcksift2_saveweights_take2 branch July 4, 2023 12:54
@Lestropie Lestropie restored the tcksift2_saveweights_take2 branch August 26, 2025 08:11
@Lestropie Lestropie deleted the tcksift2_saveweights_take2 branch August 27, 2025 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants