I answer that, Mercy and truth are necessarily found in all God's works, if mercy be taken to mean the removal of any kind of defect. Not every defect, however, can properly be called a misery; but only defect in a rational nature whose lot is to be happy; for misery is opposed to happiness.
 Thomas Aquinas, Summa Theologica (1274). copy citation

add
Author Thomas Aquinas
Source Summa Theologica
Topic happiness misery
Date 1274
Language English
Reference
Note Translated by Fathers of the English Dominican Province
Weblink http://www.gutenberg.org/cache/epub/17611/pg17611-images.html

Context

“Thus both justice and mercy presuppose something in their works: whereas creation presupposes nothing. Therefore in creation neither mercy nor justice is found.
On the contrary, It is said (Ps. 24:10) : "All the ways of the Lord are mercy and truth."
I answer that, Mercy and truth are necessarily found in all God's works, if mercy be taken to mean the removal of any kind of defect. Not every defect, however, can properly be called a misery; but only defect in a rational nature whose lot is to be happy; for misery is opposed to happiness. For this necessity there is a reason, because since a debt paid according to the divine justice is one due either to God, or to some creature, neither the one nor the other can be lacking in any work of God: because God can do nothing that is not in accord with His wisdom and goodness; and it is in this sense, as we have said, that anything is due to God.” source