resourceLoader.getName(), configName, pex.getCause(), pex.getMessage());
/** * Creates a math transform object from a <A * HREF="http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/doc-files/WKT.html"><cite>Well * Known Text</cite> (WKT)</A>. * * @param text Math transform encoded in Well-Known Text format. * @return The math transform (never {@code null}). * @throws FactoryException if the Well-Known Text can't be parsed, or if the math transform * creation failed from some other reason. */ public synchronized MathTransform createFromWKT(final String text) throws FactoryException { // Note: while this factory is thread safe, the WKT parser is not. // Since we share a single instance of this parser, we must // synchronize. if (parser == null) { parser = new MathTransformParser(Symbols.DEFAULT, this); } try { return parser.parseMathTransform(text); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception); } }
/** * Creates a coordinate reference system object from a string. * * @param wkt Coordinate system encoded in Well-Known Text format. * @throws FactoryException if the object creation failed. */ public synchronized CoordinateReferenceSystem createFromWKT(final String wkt) throws FactoryException { /* * Note: while this factory is thread safe, the WKT parser is not. * Since we share a single instance of this parser, we must synchronize. */ if (parser == null) { createParser(ReferencingFactoryFinder.getDatumFactory(null), getMathTransformFactory()); } try { return parser.parseCoordinateReferenceSystem(wkt); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception); } }
new ParseException(exception.getLocalizedMessage(), errorOffset - shift); adjusted.setStackTrace(exception.getStackTrace()); adjusted.initCause(exception.getCause()); throw adjusted;
private Date getToday(){ Date retValue = null; try { String auxDate = (new SimpleDateFormat(internalDateFormat,currentLocale)).format(new Date()); //Ahora que saque la hora y los minutos, lo llevo a Date de nuevo. retValue = (new SimpleDateFormat(internalDateFormat,currentLocale)).parse(auxDate); }catch(ParseException e){ track.fail("Error al Obtener 'TODAY' \n Mensaje:" +e.getMessage() +"Causa:\n" +e.getCause()); } return retValue; }
private Date getYesterday(){ Date retValue = null; try { String auxDate = (new SimpleDateFormat(internalDateFormat,currentLocale)).format(new Date()); //Ahora que saque la hora y los minutos, lo llevo a Date de nuevo. retValue = (new SimpleDateFormat(internalDateFormat,currentLocale)).parse(auxDate); retValue= addDate(retValue,-1); }catch(ParseException e){ track.fail("Error al Obtener 'YESTERDAY' \n Mensaje:" +e.getMessage() +"Causa:\n" +e.getCause()); } return retValue; }
private Date getTomorrow(){ Date retValue = null; try { String auxDate = (new SimpleDateFormat(internalDateFormat,currentLocale)).format(new Date()); //Ahora que saque la hora y los minutos, lo llevo a Date de nuevo. retValue = (new SimpleDateFormat(internalDateFormat,currentLocale)).parse(auxDate); retValue= addDate(retValue,+1); }catch(ParseException e){ track.fail("Error al Obtener 'TOMORROW' \n Mensaje:" +e.getMessage() +"Causa:\n" +e.getCause()); } return retValue; }
protected void process(Context context, Promise<Void> promise) { HttpServletRequest request = context.request; try { try { ServerMessage.Mutable[] messages = parseMessages(request); if (_logger.isDebugEnabled()) { _logger.debug("Parsed {} messages", messages == null ? -1 : messages.length); } if (messages != null) { processMessages(context, messages, promise); } else { promise.succeed(null); } } catch (ParseException x) { handleJSONParseException(request, context.response, x.getMessage(), x.getCause()); promise.succeed(null); } } catch (Throwable x) { promise.fail(x); } }
private static CronSyntaxException mapGeneral(final String cronExpression, final ParseException pe) { Throwable cause = pe.getCause(); if (cause == null) { cause = pe; } return CronSyntaxException.builder() .cronExpression(cronExpression) .errorCode(INTERNAL_PARSER_FAILURE) .cause(cause) .value(pe.getMessage()) .build(); }
/** * Creates the object from a string and log the warnings if any. * This method is for implementation of {@code createFromWKT(String)} method is SIS factories only. * * @param text coordinate system encoded in Well-Known Text format (version 1 or 2). * @return the result of parsing the given text. * @throws FactoryException if the object creation failed. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createFromWKT(String) * @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#createFromWKT(String) */ @Override public final Object createFromWKT(final String text) throws FactoryException { final Object value; try { value = parseObject(text, new ParsePosition(0)); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception.getLocalizedMessage(), exception); } final Warnings warnings = getAndClearWarnings(value); if (warnings != null) { log(new LogRecord(Level.WARNING, warnings.toString())); } return value; }
/** * Creates the object from a string and log the warnings if any. * This method is for implementation of {@code createFromWKT(String)} method is SIS factories only. * * @param text coordinate system encoded in Well-Known Text format (version 1 or 2). * @return the result of parsing the given text. * @throws FactoryException if the object creation failed. * * @see org.apache.sis.referencing.factory.GeodeticObjectFactory#createFromWKT(String) * @see org.apache.sis.referencing.operation.transform.DefaultMathTransformFactory#createFromWKT(String) */ @Override public final Object createFromWKT(final String text) throws FactoryException { final Object value; try { value = parseObject(text, new ParsePosition(0)); } catch (ParseException exception) { final Throwable cause = exception.getCause(); if (cause instanceof FactoryException) { throw (FactoryException) cause; } throw new FactoryException(exception.getLocalizedMessage(), exception); } final Warnings warnings = getAndClearWarnings(value); if (warnings != null) { log(new LogRecord(Level.WARNING, warnings.toString())); } return value; }
resourceLoader.getName(), configName, pex.getCause(), pex.getMessage());
+e.getMessage() +"Causa:\n" +e.getCause());
results = filterByActionTime(results,actionTimeString); } catch (ParseException e) { LOG.warn("caught ParseException while filtering results by Missed Action Time. Cause: " + e.getCause());
private void assertBad(String spec) { try { HostSpecifier.fromValid(spec); fail("Should have thrown IllegalArgumentException: " + spec); } catch (IllegalArgumentException expected) { } try { HostSpecifier.from(spec); fail("Should have thrown ParseException: " + spec); } catch (ParseException expected) { assertThat(expected.getCause()).isInstanceOf(IllegalArgumentException.class); } assertFalse(HostSpecifier.isValid(spec)); }
complete(writer); } catch (ParseException x) { handleJSONParseException(request, response, x.getMessage(), x.getCause()); } finally {