|
27 | 27 | import com.intellij.openapi.application.ModalityState; |
28 | 28 | import com.intellij.openapi.project.Project; |
29 | 29 | import com.intellij.openapi.ui.DialogWrapper; |
30 | | -import com.intellij.openapi.ui.popup.IconButton; |
31 | 30 | import com.microsoft.azure.hdinsight.common.ClusterManagerEx; |
32 | 31 | import com.microsoft.azure.hdinsight.sdk.cluster.HDInsightAdditionalClusterDetail; |
33 | 32 | import com.microsoft.azure.hdinsight.sdk.common.AuthenticationException; |
34 | | -import com.microsoft.azure.hdinsight.sdk.common.HDIException; |
35 | 33 | import com.microsoft.azure.hdinsight.sdk.storage.HDStorageAccount; |
36 | | -import com.microsoft.azure.hdinsight.serverexplore.AddHDInsightAdditionalClusterImpl; |
37 | 34 | import com.microsoft.azure.hdinsight.serverexplore.hdinsightnode.HDInsightRootModule; |
38 | 35 | import com.microsoft.azure.hdinsight.spark.jobs.JobUtils; |
39 | 36 | import com.microsoft.azuretools.azurecommons.helpers.AzureCmdException; |
@@ -232,9 +229,15 @@ protected void doOKAction() { |
232 | 229 |
|
233 | 230 | ClusterManagerEx.getInstance().addHDInsightAdditionalCluster(hdInsightAdditionalClusterDetail); |
234 | 231 | hdInsightModule.refreshWithoutAsync(); |
235 | | - } catch (Exception ignore) { |
| 232 | + } catch (AuthenticationException authErr) { |
236 | 233 | isCarryOnNextStep = false; |
237 | | - errorMessage = "Wrong username/password to log in"; |
| 234 | + errorMessage = "Authentication Error: " + Optional.ofNullable(authErr.getMessage()) |
| 235 | + .filter(msg -> !msg.isEmpty()) |
| 236 | + .orElse("Wrong username/password") + |
| 237 | + " (" + authErr.getErrorCode() + ")"; |
| 238 | + } catch (Exception ex) { |
| 239 | + isCarryOnNextStep = false; |
| 240 | + errorMessage = "Authentication Error: " + ex.getMessage(); |
238 | 241 | } |
239 | 242 | } |
240 | 243 | } |
|
0 commit comments