The solution is both simple and easy, NonFatal (t) instead of matching against NoSuchElement... then I suggest putting 't' as cause in the newly created exception.