Cleaner error logging

The error message for NoSuchXxxError should be generated by the Exception class.