bbdriver
asked on
Creating Images - JavaME
I am creating images using the following code..However, my app will stop after printing out STATEMENT 3 which means I can't use Image image = Image.createImage(input);
Is there anyway I can ctach this type of excpetion beside IOexception and Exception?
Does anyone have any idea? Thank in advance.
FileConnection filenames = (FileConnection)Connector. open(main_ directory + "testFolder" + "/"
+ imageName ,Connector.READ);
InputStream input = filenames.openInputStream( );
try {
Logger.logEventInfo("STATE MENT 3");
Image image = Image.createImage(input);
Logger.logEventInfo("READI NG: " + imageName +"\n");
Logger.logEventInfo("STATE MENT 4");
if(image != null){
Logger.logEventInfo("STATE MENT 5");
}
else continue;
Logger.logEventInfo("STATE MENT 7");
}
catch (IOException e) {
Logger.logEventInfo("STATE MENT 8");
description = e.toString();
Logger.logEventInfo("STATE MENT 9");
Logger.logEventInfo("READI NG: " + imageName +"\n");
} catch (Exception e) {
Logger.logEventInfo("STATE MENT 11");
Exceptiondescription = e.toString();
Logger.logEventInfo("STATE MENT 12");
updateContent("READING: " + imageName);
Logger.logEventInfo("READI NG: " + imageName +"\n");
Logger.logEventInfo("STATE MENT 13");
}
Logger.logEventInfo("STATE MENT 14");
input.close();
Is there anyway I can ctach this type of excpetion beside IOexception and Exception?
Does anyone have any idea? Thank in advance.
FileConnection filenames = (FileConnection)Connector.
+ imageName ,Connector.READ);
InputStream input = filenames.openInputStream(
try {
Logger.logEventInfo("STATE
Image image = Image.createImage(input);
Logger.logEventInfo("READI
Logger.logEventInfo("STATE
if(image != null){
Logger.logEventInfo("STATE
}
else continue;
Logger.logEventInfo("STATE
}
catch (IOException e) {
Logger.logEventInfo("STATE
description = e.toString();
Logger.logEventInfo("STATE
Logger.logEventInfo("READI
} catch (Exception e) {
Logger.logEventInfo("STATE
Exceptiondescription = e.toString();
Logger.logEventInfo("STATE
updateContent("READING: " + imageName);
Logger.logEventInfo("READI
Logger.logEventInfo("STATE
}
Logger.logEventInfo("STATE
input.close();
Can you show the code you use to get and configure the logger? That might provide some insight into why it is throwing an error to begin with.
ASKER
I am not sure if it's about the logger cause some of other images are able to pass STATEMENT 3 and goes into either createimage or Exception. However, for some image, it was unable to go anywhere
ASKER
What kind can I use to catch the exception beside IOException and Exception?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.