The Kiwi driver said he'll bounce back next year but right now, it's a tough pill to swallow.
The little encouragement appeared to work as Hartley improved five places from last on the starting grid to finish 15th.
Hartley will look to end this year's World Endurance Championship on a high with a winning result for Porsche in tomorrow morning's Six Hours of Bahrain event.
Hamilton, who won his fourth Formula One championship two weeks ago in Mexico, walked away from the car without injury.
After surging six places to 11th in the race, the Kiwi driver was forced from the track due to yet another engine problem.