I think the most heart-wrenching death of a literary character occurs in Anthony Trollope's novel The Last Chronicle of Barset. It haunted me for days after I first read it and I spent many sleepless hours at night wondering why - why was I so disturbed by this death? It was not violent or physically painful; in fact, it was a rather quiet death. After analyzing my reaction, I concluded that I had not anticipated the law of cause and effect. I was caught unaware by the logic of the death. It happened the way it did because of choices the character made throughout the novel. She caused the nature of her death.
Trollope is one of those authors who is kind to his readers. He will break the "fourth wall" in a novel to assure us that all will end well for a particular character. He does this so that his readers do not spend the whole time agonizing about a favorite character's fate. I appreciate that. I can get distracted worrying about characters and sometimes will even read the ending beforehand to make sure they are okay.
But sometimes a character cannot be okay in the end because of cause-and-effect. In the case of this particular character, I wanted her to bear the consequences of her actions, but not to the point of death. I would have preferred another ending for her but that would not have been true to the circumstances. And Anthony Trollope is an honest writer. He well understands the law of cause and effect and employs it skillfully in his novels.