It depends on the technical expertise of your users
For highly technical products like mobile phone WiFi scanners, it's appropriate and appreciated to include detailed and accurate error messages. For general public apps, perhaps just enough errors.
Remember that an error is the app/program saying "Something broke and I can't fix it. I need you to fix it." If your error messages don't enable your users to fix that problem, then you have failed.
My favorite example of complete, I mean complete, error messages is IBM MQ. For absolutely everything that can go wrong, there's an error code and description to go with it. Granted, this product is for highly skilled and dedicated users but it illustrates the completeness that error messages can have.
On the other extreme, "an error occurred. Try again later". This will kill your UX instantly. Full stop.
For your app, you'll want to include error messages for all the things that your users can do something about. If possible give them pointers on how to fix it. In really off the wall circumstances, perhaps an error code and a link to where they can look up more info and possible resolutions.
Error codes and messages cost developer/UX time so you probably will never do all errors. Conversely, you have to have some or the product isn't usable. It will depend on your all and your users.