Thread: Can anyone explain this error to me? I need to learn what this error means.

Results 1 to 5 of 5
  1. #1 Can anyone explain this error to me? I need to learn what this error means. 
    Banned

    Join Date
    Aug 2008
    Posts
    1,905
    Thanks
    57
    Thanked 102 Times in 77 Posts
    Rep Power
    0
    Code:
    src\server\Server.java:131: unreported exception java.lang.Exception; must be ca
    ught or declared to be thrown
                    WalkingHandler.getSingleton().initialize();
                                                            ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Please explain, would really be helpful
    Reply With Quote  
     

  2. #2  
    Donator


    Join Date
    Nov 2008
    Posts
    2,233
    Thanks
    338
    Thanked 56 Times in 43 Posts
    Rep Power
    233
    okay kind of explains it self i think
    Code:
    must be ca
    ught or declared to be thrown
    this is a guess but im thinking you need to declare that somewhere for it work
    because it says it must be declared to be thrown so it must be declared so it works
    This is a lol



    Wohooo rep from scu11 for a real reason lol


    Reply With Quote  
     

  3. #3  
    Member

    Join Date
    May 2008
    Posts
    1,288
    Thanks
    50
    Thanked 87 Times in 66 Posts
    Rep Power
    0
    Quote Originally Posted by Mr Impact View Post
    Code:
    src\server\Server.java:131: unreported exception java.lang.Exception; must be ca
    ught or declared to be thrown
                    WalkingHandler.getSingleton().initialize();
                                                            ^
    Note: Some input files use unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    Please explain, would really be helpful
    The method initialize() in WalkingHandler.java is like this: (notice "throws Exception")
    Code:
    public WalkingHandler initialize() throws Exception {
          //  ..
          return this;
    }
    So you need to catch the exception it throws:
    Code:
    try {
        WalkingHandler.getSingleton().initialize();
    } catch(Exception ex){
        ex.printStackTrace();
    }
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Aug 2008
    Posts
    1,905
    Thanks
    57
    Thanked 102 Times in 77 Posts
    Rep Power
    0
    Quote Originally Posted by Clifton View Post
    The method initialize() in WalkingHandler.java is like this: (notice "throws Exception")
    Code:
    public WalkingHandler initialize() throws Exception {
          //  ..
          return this;
    }
    So you need to catch the exception it throws:
    Code:
    try {
        WalkingHandler.getSingleton().initialize();
    } catch(Exception ex){
        ex.printStackTrace();
    }
    Thanks for your help
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Nov 2008
    Posts
    2,233
    Thanks
    338
    Thanked 56 Times in 43 Posts
    Rep Power
    233
    Quote Originally Posted by Clifton View Post
    The method initialize() in WalkingHandler.java is like this: (notice "throws Exception")
    Code:
    public WalkingHandler initialize() throws Exception {
          //  ..
          return this;
    }
    So you need to catch the exception it throws:
    Code:
    try {
        WalkingHandler.getSingleton().initialize();
    } catch(Exception ex){
        ex.printStackTrace();
    }
    i just learned something :O:trollface:
    This is a lol



    Wohooo rep from scu11 for a real reason lol


    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •