Most languages I encounter have recently put a lot of work into better error messages, with the charge having been led by Elm with Compiler Errors for Humans [elm-lang.org], but it may be worth seeing if there’s a linter that can not only better diagnose but even automatically fix stuff like that. (Java and C++ errors were verbose enough to inspire filters to present them more clearly, but that doesn’t sound like the case here.)

Come to think, inscrutable PHP error messages were what introduced me to the phrase “Paamayim Nekudotayim” [php.net].

/