/** @inheritDoc */ public String toString() { String s = this.getClass().getName(); String message = super.getLocalizedMessage(); if (message != null) { message = s + ": " + message; } else { message = s; } if (this.getCause() != null) { message = message + "\nOriginal Exception was " + this.getCause().toString(); } return message; }
/** * Rollback the transaction. If there is a RuntimeException during rollback, * it will be logged but the transaction instance variable will still be * nullified. */ private void rollbackTransaction() { if (transaction != null) { try { // If the transaction wasn't committed before we got the exception, we // need to rollback. transaction.rollback(); } catch (RuntimeException ex) { LOG.error("Transaction rollback failed: " + ex.getLocalizedMessage()); LOG.debug("Exception follows.", ex); } finally { transaction.close(); this.transaction = null; } } }
private static GemFireCacheImpl basicCreate(InternalDistributedSystem system, boolean existingOk, CacheConfig cacheConfig, PoolFactory pf, boolean isClient, boolean asyncEventListeners, TypeRegistry typeRegistry) throws CacheExistsException, TimeoutException, CacheWriterException, GatewayException, RegionExistsException { try { synchronized (GemFireCacheImpl.class) { GemFireCacheImpl instance = checkExistingCache(existingOk, cacheConfig, system); if (instance == null) { instance = new GemFireCacheImpl(isClient, pf, system, cacheConfig, asyncEventListeners, typeRegistry); system.setCache(instance); instance.initialize(); } else { system.setCache(instance); } return instance; } } catch (CacheXmlException | IllegalArgumentException e) { logger.error(e.getLocalizedMessage()); // TODO: log the full stack trace or not? throw e; } catch (Error | RuntimeException e) { logger.error(e); throw e; } }
result.setKey(key); } catch (AssetNotFoundException | AssetLoadException e) { LOGGER.fine(e.getLocalizedMessage()); LOGGER.fine(e.getLocalizedMessage()); assetManager.loadTexture(key); } catch (AssetNotFoundException | AssetLoadException e) { LOGGER.fine(e.getLocalizedMessage());
RuntimeException exception = new RuntimeException( "Failed to start temp data store: " + tempDataStore, e); LOG.error(exception.getLocalizedMessage(), e); throw exception; RuntimeException exception = new RuntimeException( "Failed to start job scheduler store: " + jobSchedulerStore, e); LOG.error(exception.getLocalizedMessage(), e); throw exception;
@Override public void undeploy(DeploymentUnit deploymentUnit) { if (deploymentUnit.getParent() != null && deploymentUnit.getParent().getParent() != null) { // We only expose management resources 2 levels deep return; } // Iterate through each component, uninstalling it for (final InstalledComponent configuration : deploymentUnit.getAttachmentList(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS)) { try { uninstallManagementResource(configuration, deploymentUnit); } catch (RuntimeException e) { EjbLogger.DEPLOYMENT_LOGGER.failedToRemoveManagementResources(configuration, e.getLocalizedMessage()); } } deploymentUnit.removeAttachment(EjbDeploymentAttachmentKeys.MANAGED_COMPONENTS); }
data.result = new Object[] {"UserAbortedSync" }; mediaError = AnkiDroidApp.getAppResources().getString(R.string.sync_media_error) + "\n\n" + e.getLocalizedMessage();
} catch (IOException error) { RuntimeException runtimeException = new RuntimeException("Failed to persist JMSRedeliveryFlag on " + message.getMessageId() + " in " + message.getDestination(), error); LOG.warn(runtimeException.getLocalizedMessage(), runtimeException); throw runtimeException; } finally {
} catch (RuntimeException e) { Log.d(TAG, "Cannot initialize Amazon Mobile Analytics SDK", e); throw new InitializationException(e.getLocalizedMessage());
@Override public String getLocalizedMessage() { return msg.getAdditionalInformation(super.getLocalizedMessage()); }
private String parseJsonString(String name, String value) { try { /* * Use getAsJsonPrimitive() first in order to throw an exception * if the element is an array, number, or other */ return jsonParser.parse( value ).getAsJsonPrimitive().getAsString(); } catch (JsonParseException | ClassCastException | IllegalStateException e) { throw LOG.invalidAnalysisDefinitionJsonStringParameter( factoryClass, name, e.getLocalizedMessage(), e ); } }
private String parseJsonString(String name, String value) { try { /* * Use getAsJsonPrimitive() first in order to throw an exception * if the element is an array, number, or other */ return jsonParser.parse( value ).getAsJsonPrimitive().getAsString(); } catch (JsonParseException | ClassCastException | IllegalStateException e) { throw LOG.invalidAnalysisDefinitionJsonStringParameter( factoryClass, name, e.getLocalizedMessage(), e ); } }
} catch (RuntimeException e) { Log.d(TAG, "Cannot initialize Amazon Mobile Analytics SDK", e); throw new InitializationException(e.getLocalizedMessage());
@Override public IUser getUser(final String userId) throws UmiException { try { return umiUserManager.getUser(userId); } catch (final RuntimeException e) { final String message = MessageFormat.format("Can''t get user {0}: {1}. See server logs for detailed information.", userId, e.getLocalizedMessage()); //$NON-NLS-1$ logger.error(message, e); throw new UmiException(e, message); } }
@Override public void remove(String id) throws ServerException { requireNonNull(id, "Required non-null id"); try { doRemove(id); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
@Override public void remove(String id) throws ServerException { requireNonNull(id, "Required non-null id"); try { doRemove(id); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
} catch (final RuntimeException e) { log.debug("Cannot initialize Pinpoint SDK", e); throw new AmazonClientException(e.getLocalizedMessage());
private void notifyRemovedLocalBundle( ConnectionBundle bundle ) { // Notify listeners notifyRemovedConnectionBundle( bundle ); // Notify remote intercoms for ( Intercom4 intercom : getRemoteIntercoms() ) { try { intercom.removeRemoteBundle( bundle ); } catch ( RuntimeException e ) { LOG.error( "Unexpected exception: " + e.getLocalizedMessage(), e ); } } }
@Override public void remove(String id) throws ServerException { requireNonNull(id, "Required non-null id"); try { Optional<WorkspaceImpl> workspaceOpt = doRemove(id); workspaceOpt.ifPresent( workspace -> eventService.publish(new WorkspaceRemovedEvent(workspace))); } catch (RuntimeException x) { throw new ServerException(x.getLocalizedMessage(), x); } }
@Override public String getLocalizedMessage() { if(!MockFramework.isEnabled()){ return super.getLocalizedMessage(); } return getDelegate().getLocalizedMessage(); }