Oh, I know it's not yours (or mine, let me disavow!) But since you touched it, does this work?

https://mxr.mozilla.org/mozilla-central/ident?i=getErrorMessage