Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Data Persistence Introduction to Data Persistence Handling an Exception

Esteban Aparicio
Esteban Aparicio
10,725 Points

I don't think the checker is working correctly for this challenge.

I wrapped the given code with a try/catch but I get this error when I try to submit my answer:

JavaTester.java:22: error: exception Exception is never thrown in body of corresponding try statement
    } catch(Exception ex) {
      ^
1 error
CodeChallenge.java
// assetManager, assetName, and fileToWrite have been initialized elsewhere

try {
  InputStream in = assetManager.open(assetName);
  FileOutputStream out = new FileOutputStream(fileToWrite);
  copyFile(in, out);
} catch (Exception e) {
  e.printStackTrace();
}

1 Answer

Craig Dennis
STAFF
Craig Dennis
Treehouse Teacher

Can you try this again please? I think we fixed it.

Esteban Aparicio
Esteban Aparicio
10,725 Points

Yep, I tried it again a few minutes ago and it worked. Thanks

This Android Data Persistence course has had a couple of issues. You guys should go through all of the user posts on the lessons. There is a spot where the teacher mentions copy/pasting something from the Teacher Notes... except it's not there. Some helpful user added a post with the missing text like 2 months ago. There's other places where the downloaded project files don't quite match up with the video instructions. Nothing has been a big problem but it's just several small issues which I haven't experienced with other courses.