The vain man makes a merit of misfortune, and triumphs in his disgrace.
William Hazlitt (1871). “The Round Table. A collection of Essays ... By W. H. and Leigh Hunt”, p.473

The vain man makes a merit of misfortune, and triumphs in his disgrace.