Package yalp.exceptions

Examples of yalp.exceptions.UnexpectedException


                closeConnection(connection);
                Logger.error(e, "Can't apply evolution");
                return false;
            }
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here


                        script = "# --- Rev:" + revision + "," + (state.equals("applying_up") ? "Ups" : "Downs") + " - " + hash + "\n\n" + script;
                        String error = rs.getString("last_problem");
                        throw new InconsistentDatabase(script, error, revision);
                    }
                } catch (SQLException e) {
                    throw new UnexpectedException(e);
                } finally {
                    closeConnection(connection);
                }

                if (!evolutionScript.isEmpty()) {
View Full Code Here

        try {
            if (connection != null) {
                connection.close();
            }
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here

                ((Enhancer) enhancer.newInstance()).enhanceThisClass(applicationClass);
                if (Logger.isTraceEnabled()) {
                    Logger.trace("%sms to apply %s to %s", System.currentTimeMillis() - start, enhancer.getSimpleName(), applicationClass.name);
                }
            } catch (Exception e) {
                throw new UnexpectedException("While applying " + enhancer + " on " + applicationClass.name, e);
            }
        }
    }
View Full Code Here

                    if (message.indexOf("@") > 0) {
                        message = message.substring(0, message.lastIndexOf("@"));
                    }
                    throw new TemplateCompilationException(this, line, message);
                }
                throw new UnexpectedException(e);
            } catch (Exception e) {
                throw new UnexpectedException(e);
            }
        }
        compiledTemplateName = compiledTemplate.getName();
    }
View Full Code Here

            Field field = getField(clazz, propertyNames[i]);
            field.setAccessible(true);
            try {
                values[i] = field.get(model);
            } catch (Exception ex) {
                throw new UnexpectedException(ex);
            }
            if (i > 0) {
                jpql.append(" And ");
            }
            jpql.append("o.").append(propertyNames[i]).append(" = ?" + String.valueOf(index++) + " ");
View Full Code Here

                } catch (NoSuchFieldException e) {
                    c = c.getSuperclass();
                }
            }
        } catch (Exception e) {
            throw new UnexpectedException("Error while determining the field " +
                    fieldName + " for an object of type " + clazz);
        }
        throw new UnexpectedException("Cannot get the field " + fieldName +
                " for an object of type " + clazz);
    }
View Full Code Here

     */
    public static void deleteDirectory(String path) {
        try {
            FileUtils.deleteDirectory(Yalp.getFile(path));
        } catch (IOException ex) {
            throw new UnexpectedException(ex);
        }
    }
View Full Code Here

    @Override
    public void configure(InPast past) {
        try {
            this.reference = past.value().equals("") ? new Date() : AlternativeDateFormat.getDefaultFormatter().parse(past.value());
        } catch (ParseException ex) {
            throw new UnexpectedException("Cannot parse date " + past.value(), ex);
        }
        if (!past.value().equals("") && past.message().equals(mes)) {
            setMessage("validation.before");
        } else {
            setMessage(past.message());
View Full Code Here

                    }
                } catch (Exception e) {
                    if (e instanceof YalpException) {
                        throw (YalpException) e;
                    }
                    throw new UnexpectedException(e);
                }
            }
View Full Code Here

TOP

Related Classes of yalp.exceptions.UnexpectedException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.