Added catch block that writes full exception to c: