I have a program that copies certain files to a floppy disk, and if someone clicks the "create floppy" button, and there is a floppy disk in it, it writes to the dsik.

but if there is no floppy disk in there then a runtime error comes up and it closes the program, is there something that I can do to make an error message come up saying that there is no floppy, instead of having the program crash?