It looks like FS.createObject can throw a wide variety of exceptions.

I'd just copied it from what mknod was doing, and I copied it because mknod will now correctly error out if you try to create a directory with it.