catch exception and add input sentence to debugging output