@Override public Response toResponse(final BatchRuntimeException e) { return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build(); } }
private String reresolve(final String expression, final String currentlyResolvedToVal, final boolean defaultAllowed, LinkedList<String> referringExpressions) throws BatchRuntimeException { if (currentlyResolvedToVal.length() < shortestTemplateLen || !currentlyResolvedToVal.contains(prefix)) { return currentlyResolvedToVal; } if (referringExpressions == null) { referringExpressions = new LinkedList<String>(); } referringExpressions.add(expression); final StringBuilder sb = new StringBuilder(currentlyResolvedToVal); try { resolve(sb, 0, defaultAllowed, referringExpressions); } catch (final BatchRuntimeException e) { LOGGER.unresolvableExpression(e.getMessage()); return null; } return sb.toString(); }
/** * Resolves an expression from the raw value. * * @param rawVale the raw value * * @return the resolved string or {@code null} if unresolvable * * @throws java.lang.SecurityException if a security manager is installed, {@code systemProperties} is requested * and the system property permission is not set. */ String resolve(final String rawVale) { if (rawVale.length() < shortestTemplateLen || !rawVale.contains(prefix)) { return rawVale; } final StringBuilder sb = new StringBuilder(rawVale); try { resolve(sb, 0, true, null); } catch (final BatchRuntimeException e) { LOGGER.unresolvableExpression(e.getMessage()); return null; } return sb.toString(); }
String error = "Error creating FilesystemImportJob with dataset with ID: " + dataset.getId() + " - " + ex.getMessage(); logger.info(error); throw new IllegalCommandException(error, this);