WIP: 1001629 handle exceptions in Index

Hi,

I'm opening this pull request so you can see my work in progress and such that it is easier to discuss code. This is mostly for @dotta

Cheers,
Mads