Fix NotFound exception catching

Fixes bug #1147011

Change-Id: I85c498b42b570ce4461d3fe313215fd73d476080