Handle exception from Nipap class

Additionally changed the order so we don't have to handle the exception
twice.