Guest User

Untitled

a guest
Oct 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. ...
  2. DerbyNow() throws IOException {
  3. // create socket connection
  4. socket = new EventSocket(new Socket(DERBY_NOW_HOST, DERBY_NOW_PORT)) // EventSocket throws IOException as well
  5. ...
  6.  
  7. try {
  8. DerbyNow derbyNow = new DerbyNow();
  9.  
  10. setDerbyNow(derbyNow);
  11. } catch (IOException e) {
  12. Log.bad("error while setting up Derby Now: ", e);
  13. }
  14.  
  15. Error:(382, 19) java: exception java.io.IOException is never thrown in body of corresponding try statement
  16.  
  17. apply plugin: 'java'
  18. apply plugin: 'groovy'
  19.  
  20. ...
  21.  
  22. repositories {
  23. mavenCentral()
  24. mavenLocal()
  25. ...
  26. }
  27.  
  28. ...
  29.  
  30. dependencies {
  31. compile 'org.codehaus.groovy:groovy-all:2.3.11'
  32. ...
  33. }
  34.  
  35. try {
  36. DerbyNow derbyNow = new DerbyNow();
  37.  
  38. setDerbyNow(derbyNow);
  39. } catch (Exception e) {
  40. if (e instanceOf IOException) {
  41. Log.bad("error while setting up Derby Now: ", e);
  42. } else {
  43. throw e;
  44. }
  45. }
Add Comment
Please, Sign In to add comment