-
Notifications
You must be signed in to change notification settings - Fork 168
Description
Not sure if this is intentional or not but currently the GetHash function only includes the Exception.ToString() and optionally MachineName but it does not consider custom Exception metadata - for example (from opserver):
Source for the GetHash function:
StackExchange.Exceptional/src/StackExchange.Exceptional.Shared/Error.cs
Lines 230 to 244 in 107b864
| /// <summary> | |
| /// Gets a unique-enough hash of this error. Stored as a quick comparison mechanism to roll-up duplicate errors. | |
| /// </summary> | |
| /// <param name="includeMachine">Whether to include <see cref="MachineName"/> in the has calculation, creating per-machine roll-ups.</param> | |
| /// <returns>A "Unique" hash for this error.</returns> | |
| public int? GetHash(bool includeMachine) | |
| { | |
| if (!Detail.HasValue()) return null; | |
| var result = Detail.GetHashCode(); | |
| if (includeMachine && MachineName.HasValue()) | |
| result = (result * 397) ^ MachineName.GetHashCode(); | |
| return result; | |
| } |
We find this information helpful to recover from what happened here but what seems to happen is that multiple errors with different information get rolled up into one and only one of the exception's message remains and the others are lost
That's cool if this was intended but thought I'd check, may be worth at least having an option for it like the MachineName
Happy to do a PR to implement this if you agree that it always should / should have an option to 😄
