Throwing the wrong exception.

We were not throwing and catching the same exception, this lead to exceptions
leaking out to end user when using node index seek with a non-existing id.
Merge pull request #3371 from pontusmelke/throwing-wrong-exception

Throwing the wrong exception.