Why grouping errors prioritize stacktraces over exception interface?

I have two different errors with exactly the same stacktrace, the same error type but a different error messages.

Error 1: ValidationError: city location is invalid,
Error 2: ValidationError: user location is invalid

These two errors are grouped together by Sentry which effectively makes Error2 invisible at the first look! It should be a separate error entry in Sentry.
I’ve read https://docs.sentry.io/learn/rollups/#grouping-by-stacktrace and it’s clearly stated that if stacktrace is available the grouping will be based on it.
I think it’s visible in source code here: https://github.com/getsentry/raven-js/blob/d3d6f989f1c2cd94fd4216e6a0a3d0deac7cb823/src/raven.js#L1787

Why is stacktrace more important than an error type and its message?

1 Like