FileFactory question on IOException reason

General discussion on the JZOS batch launcher and toolkit
Post Reply
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

FileFactory question on IOException reason

Post by JohnMcKown »

The only exception which is thrown by the methods in the FileFactory class is the java.io.IOException. Does FileFactory include a "message" which explains the reason for the IOException? E.g.

try {
infile=FileFactory.newBufferedInputStream("//DD:INPUT");
} catch (java.io.IOException e) {
System.out.println(e.getMessage());
throw new RuntimeException(e);
}

I ask because the reasons could be many. Such as a S213-04 (dataset not on volume), S913 (security violation), and likely others. Is this message architected so that I could perhaps render a more user-friendly message or programmed response?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

If you get an exception in ZFile-related code, the actual exeception thrown with be a ZFileException. This is a subclass of IOException, and has additional fields that have info related to the failure.
JohnMcKown
Posts: 39
Joined: Sat Nov 21, 2009 2:59 pm

Many thanks!

Post by JohnMcKown »

That gets me what I need to know.
Post Reply