Skip to content

Instantly share code, notes, and snippets.

@hakanai
Created August 2, 2010 05:31
Show Gist options
  • Select an option

  • Save hakanai/504155 to your computer and use it in GitHub Desktop.

Select an option

Save hakanai/504155 to your computer and use it in GitHub Desktop.
//
// Find the bug - Hard Mode
//
class SomeSunLibrary {
/**
* @throws InterruptedIOException sometimes, depending on the OS and the moon.
* @throws IOException
*/
void doSomeIO() throws IOException {
try {
doSomeBlockingShit();
} catch (InterruptedException e) {
throw new InterruptedIOException(e);
}
}
}
// meanwhile, somewhere else in the universe:
class MyUsefulUtility {
private final SomeSunLibrary library;
public MyUsefulUtility(SomeSunLibrary library) {
this.library = library;
}
public void liftStuff() {
try {
library.doSomeIO();
} catch (IOException e) {
Logger.getLogger(getClass()).error("It didn't work, bro.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment