[Title] common-eplugin: improved sign error message information 70/10870/1
authorJihoon Song <jihoon80.song@samsung.com>
Mon, 14 Oct 2013 13:06:09 +0000 (22:06 +0900)
committerJihoon Song <jihoon80.song@samsung.com>
Mon, 14 Oct 2013 13:06:09 +0000 (22:06 +0900)
[Desc.]
[Issue]

Change-Id: I8218d359b5cb62a19c6fed04af9d14c1106dd850

org.tizen.common.sign/src/org/tizen/common/sign/signer/SignatureGenerator.java

index c32e5ca..2c28949 100644 (file)
@@ -36,6 +36,7 @@ import org.tizen.common.TizenPlatformConstants;
 import org.tizen.common.core.command.ExecutionContext;
 import org.tizen.common.sign.command.ReadSigningProfileFileCommand;
 import org.tizen.common.sign.command.SignCommand;
+import org.tizen.common.sign.exception.CertificationException;
 import org.tizen.common.sign.model.SignatureConstants;
 import org.tizen.common.sign.preferences.Messages;
 import org.tizen.common.sign.preferences.SigningProfile;
@@ -93,7 +94,18 @@ public class SignatureGenerator {
                     new ReadSigningProfileFileCommand(
                             SigningProfileUtil.getProfilesPath().toPortableString(),
                             getActiveProfileName() );
-            CommonPlugin.getDefault().getExecutor().execute( readProfile );
+            try {
+                CommonPlugin.getDefault().getExecutor().execute( readProfile );
+            } catch( IllegalStateException e ) {
+                Throwable cause = e.getCause();
+                
+                // convert the wrapped IllegalStateException to normal exception.
+                if ( cause instanceof CertificationException ) {
+                    throw new IOException( cause.getMessage(), cause );
+                }
+                
+                throw e;
+            }
             
             profile = readProfile.getProfile();