Not good. There could be some other error as well here. You should check what is the exception message and if it is that MongoDB is complaining about uniqueness of the index, then you throw this exception. Otherwise you just rethrow the original one.