Identifying identical exceptions

I’m working on Clem, a project to help new users better understand confusing error messages. One of the requirements for that project is to be able to identify “identical” errors, with identical being defined as error messages caused by the same error in an user’s code.

The way we’ve been trying to do this is by comparing the stacktrace and type of two exceptions. We filter the stacktrace to only contain code in Clojure core (thus removing stack trace elements in the user’s code) and assume that any matches are essentially the same exception.

This method generally works for runtime exceptions, but not for compiler exceptions, because of how Clojure forms can be nested. This is a bit of a long shot, but I wanted to know if anyone has any suggestions on how to determine if two exceptions are the same root cause (ex. undefined symbol, unmatched bracket, etc.)? Worst case I can try parsing messages, but that seems particularly error-prone, since they change based on the user’s code.

I looked into ex-triage, which is probably helpful, but didn’t see a clear path forward with it.