use of org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace in project azure-tools-for-java by Microsoft.
the class StorageAccountFolderNode method refreshItems.
@Override
protected void refreshItems() {
if (!clusterDetail.isEmulator()) {
try {
if (isStorageAccountsAvailable(clusterDetail)) {
clusterDetail.getConfigurationInfo();
Optional.ofNullable(clusterDetail.getStorageAccount()).map(defaultStorageAccount -> new StorageAccountNode(this, defaultStorageAccount, clusterDetail, true)).ifPresent(this::addChildNode);
List<HDStorageAccount> additionalStorageAccount = clusterDetail.getAdditionalStorageAccounts();
if (additionalStorageAccount != null) {
for (HDStorageAccount account : additionalStorageAccount) {
addChildNode(new StorageAccountNode(this, account, clusterDetail, false));
}
}
}
} catch (Exception ex) {
String exceptionMsg = ex.getCause() == null ? "" : ex.getCause().getMessage();
String errorHint = String.format("Failed to get HDInsight cluster %s configuration. ", clusterDetail.getName());
log().warn(errorHint + ExceptionUtils.getStackTrace(ex));
DefaultLoader.getUIHelper().showError(errorHint + exceptionMsg, "HDInsight Explorer");
}
}
}
use of org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace in project GDSC-SMLM by aherbert.
the class SeriesImageSource method openSource.
@Override
protected boolean openSource() {
// Object deserialisation of old data may have non tiff images so check.
if (!isTiffSeries || images.isEmpty()) {
return false;
}
initialise();
if (frames == 0) {
return false;
}
// Reset if already open
// (Should we support only closing the sequential reading functionality)
close();
// Open the first TIFF image
lastImage = openImage(0, images.get(0));
lastImageId = 0;
if (lastImage != null && lastImage.size > 0) {
try {
// Ignore the pixels returned. This will throw if they are null.
lastImage.getFrame(0);
setDimensions(lastImage.width, lastImage.height);
// Attempt to get the origin if a MicroManager image
final Rectangle roi = FastTiffDecoder.getOrigin(((TiffImage) lastImage).info[0]);
if (roi != null && roi.width == getWidth() && roi.height == getHeight()) {
setOrigin(roi.x, roi.y);
}
return true;
} catch (final Exception ex) {
// not bubbled up then the source is not opened.
if (trackProgress.isLog()) {
trackProgress.log("Failed to open: %s", ExceptionUtils.getStackTrace(ex));
}
}
}
return false;
}
Aggregations