your question is hard to answer, if you don’t give us any details on the implementation (Macro|Script|Plugin, minimal code example, …).
In Jython I use the following code for my batch opener:
def batch_open_images(some parameters):
# some code that is not relevant
images = 
for img_path in path_to_images:
imp = IJ.openImage(img_path)
except Exception, err:
if imp is most important, as ImageJ does not throw an exception on all images it can’t open, but returns
none instead of an ImagePlus object.
Supplement: I had a look at the relevant source code of ImageJ and found no Exception that is thrown. Just checking if the return value of
None seams to be sufficient.