just when; just as; at the very moment when; on the point of
Used when something happens right at the moment someone is about to do something, often with a nuance of interruption or coincidence. Typically follows a verb in the volitional or dictionary form + とする/とした.
出かけようとした矢先に、電話が鳴った。
Just as I was about to go out, the phone rang.
彼に話しかけようとした矢先に、彼は立ち去った。
Just when I was about to speak to him, he left.
ところに also marks a moment when something happens, but it is more neutral and does not carry the strong 'just about to' nuance of 矢先に.
Compound of 矢 (arrow) and 先 (tip, point), literally 'arrowhead', which came to mean the critical moment or point of action. The adverbial form 矢先に developed the meaning 'just at that moment'.