True, although this is just the third of a series of calls, few lines below there are the delete layer and styles, I can make it catch the right exception. In general I'm not sure that this is a good solution but just a monkey patch.