Bible

For David had done what was right in the eyes of the LORD and had not failed to keep any of the LORD’S commands all the days of his life—except in the case of Uriah the Hittite.

Also in the matter of numbering Israel:

2 Sam. 24:10 And David's heart smote him after that he had numbered the people. And David said unto the LORD, I have sinned greatly in that I have done...