~ところだった
Something almost happened
You’ll be able to say that an event came very close to happening but did not actually occur.

危うくベンチにカメラを忘れるところでした。
ayauku benchi ni kamera o wasureru tokoro deshita.
What do you think this sentence means?
I almost forgot my camera on the bench.
Almost happened, but did not
Dictionary-form verb + ところだった means that something almost happened, but did not. It describes a near miss and is often used with 危うく.
もう少しで車にぶつかるところだった。
mou sukoshi de kuruma ni butsukaru tokoro datta.
I nearly bumped into a car.
目覚ましが鳴らなかったら、遅刻するところでした。
mezamashi ga naranakattara, chikoku suru tokoro deshita.
If my alarm had not gone off, I would have been late.
Use the event that did not happen
Attach ところだった to the dictionary form of the event that nearly happened. The meaning is always that the event was avoided or did not come true.
危うく転ぶところでした。
ayauku korobu tokoro deshita.
I almost fell.
もう少しで、反対方向の電車に乗るところだった。
mou sukoshi de, hantai houkou no densha ni noru tokoro datta.
I almost got on a train going the opposite way.
うっかり同じ薬を二回飲むところでした。
ukkari onaji kusuri o nikai nomu tokoro deshita.
I carelessly almost took the same medicine twice.
値札をよく見なかったら、高いほうを買うところだった。
nefuda o yoku minakattara, takai hou o kau tokoro datta.
If I hadn’t looked carefully at the price tag, I would have bought the more expensive one.
7 more examples in the grammar path — free for a limited time.