Using try and catch you can tell the program what to do in case of an error and not just die horribly; ie usually recover gracefully. You can have something like try { open a file } catch { (if file not found) tell user it’s not found and return “no file found sorry” } otherwise it would be that if file not found -> crash and exit process
Latest Answers