Add some exception handling to file handling post