Handle exception from Nipap class

Additionally changed the order so we don't have to handle the exception
twice. Also using print function now, which requires import from \__future__