The Steipler Gaon (Rabbi Yaakov Yisrael Kanievsky ztz"l) was meticulously strict about sleeping in a Sukkah. Even when drafted into the Soviet army under brutally cold conditions, he insisted on sleeping in a Sukkah, sustained by the warmth of fulfilling the mitzvah.
One Succos, while assigned to guard a military hospital, he constructed a tiny Sukkah to sleep in while maintaining his guard duties. Military protocol dictated that if a guard spotted an advancing enemy, he was to fire a warning shot to alert the troops. Overcome with exhaustion, the Steipler drifted off to sleep, and his rifle accidentally discharged.
The garrison erupted into chaos as soldiers readied for an attack. When no enemy was found, the Steipler was summoned to explain why he had fired.
The Steipler faced a dilemma: he could easily fabricate a story about seeing a movement in the dark, thereby avoiding punishment. However, telling the truth meant admitting he fell asleep on duty, an offense punishable by death.
The Gaon calculated: the Torah commands to "Keep far from falsehood", ruling out a lie. As for the truth, he reasoned that since he had been sleeping in a Sukkah, the principle applies that "One who observes a mitzvah will know no evil matter". Trusting that Hashem would protect him, he told the exact truth.
He was promptly arrested, imprisoned alongside hardened criminals, and sentenced to death by hanging.
Yet the Gaon maintained his complete trust in Hashem. As it happened, the Czar's birthday fell during that time, a day when the monarch customarily granted pardons to select prisoners. Visiting the prison, the Czar took a personal liking to the Steipler and commuted his sentence, saving his life because he chose to tell the truth.