Handling errors when launching the file chooser