The person himself who has unsuccessfully endeavoured to confer a benefit, has by no means the same dependency upon the gratitude of the man whom he meant to oblige, nor the same sense of his own merit towards him, which he would have had in the case of success.
 Adam Smith, The Theory of Moral Sentiments (1759). copy citation

Context

“since, had it not been for the concurrence of others, all that he could have done would never have brought it about. This consideration, they imagine, should, even in the eyes of the impartial spectator, diminish the debt which they owe to him. The person himself who has unsuccessfully endeavoured to confer a benefit, has by no means the same dependency upon the gratitude of the man whom he meant to oblige, nor the same sense of his own merit towards him, which he would have had in the case of success. Even the merit of talents and abilities which some accident has hindered from producing their effects, seems in some measure imperfect, even to those who are fully convinced of their capacity to produce them.” source