unreported exception java.lang.Exception; must be caught or declared to be thrown

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • annazpereira
    New Member
    • Apr 2010
    • 2

    unreported exception java.lang.Exception; must be caught or declared to be thrown

    Hi,
    I am new to java and cannot fiugre out what is wrong with my code. I keep getting the following error:
    Upgrade.java:13 3: unreported exception java.lang.Excep tion; must be caught or declared to be thrown
    new SpFwUpgrade(sp, UrlPath);
    SpFwUpgrade is called in Upgrade.java as follows:
    Code:
     try
             {
                      new SpFwUpgrade(sp, UrlPath);
                       //new FTPGet(sp,fw,fw,fw);
             }
                    catch (STAFException e)
             {
                      return new STAFResult(e.rc, e.getMessage());
             }
    SpFwUpgrade.jav a is written as follows:
    Code:
    public class  SpFwUpgrade{
                 public SpFwUpgrade(String sp, String urlPath) throws Exception
         {
           try
            {
    
              GetFw(urlPath);
              SpFwUpgrade1(sp);
    
             }
            catch(IOException e){System.err.println(e.getMessage());}
         }
    Any hints would be greatly appreciated!!!

    Thanks
    Anna
  • annazpereira
    New Member
    • Apr 2010
    • 2

    #2
    Oh, just figured it out....was using different exceptions, dumb me!!!!

    Comment

    Working...