Package play.exceptions

Examples of play.exceptions.UnexpectedException


        try {
            getIndexWriter(name).optimize(true);
            getIndexWriter(name).commit();
            dirtyReader(name);
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here


            getIndexWriter(name).close();
            indexWriters.remove(name);
            Files.deleteDirectory(oldFolder);
            newFolder.renameTo(oldFolder);
        } catch (IOException e) {
            throw new UnexpectedException(e);
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here

                }
                File target = new File(DATA_PATH, name);
                if (target.exists() && target.isDirectory())
                    Files.deleteDirectory(target);
            } catch (Exception e) {
                throw new UnexpectedException("Can't reopen reader", e);
            }
        }
    }
View Full Code Here

        java.lang.reflect.Field field = getIdField(clazz);
        Class<?> parameter = field.getType();
        try {
            return Binder.directBind(indexValue, parameter);
        } catch (Exception e) {
            throw new UnexpectedException("Could not convert the ID from index to corresponding type", e);
        }
    }
View Full Code Here

            ZipOutputStream zos = new ZipOutputStream(os);
            zipDirectory(directory, directory, zos);
            zos.close();
            os.close();
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here

    public static Map<String, String[]> parse(String urlEncoded) {
        try {
            final String encoding = Http.Request.current().encoding;
            return new UrlEncodedParser().parse(new ByteArrayInputStream(urlEncoded.getBytes( encoding )));
        } catch (UnsupportedEncodingException ex) {
            throw new UnexpectedException(ex);
        }
    }
View Full Code Here

                decodedParams.put("body", new String[] {data});
            }

            return decodedParams;
        } catch (Exception e) {
            throw new UnexpectedException(e);
        }
    }
View Full Code Here

        } catch (FileUploadException e) {
            Logger.debug(e, "error");
            throw new IllegalStateException("Error when handling upload", e);
        } catch (Exception e) {
            Logger.debug(e, "error");
            throw new UnexpectedException(e);
        }
        return result;
    }    // ---------------------------------------------------------- Class methods
View Full Code Here

                    String jarPath = uri.getSchemeSpecificPart().substring(5, uri.getSchemeSpecificPart().lastIndexOf("!"));
                    frameworkPath = new File(jarPath).getParentFile().getParentFile().getAbsoluteFile();
                } else if (uri.getScheme().equals("file")) {
                    frameworkPath = new File(uri).getParentFile().getParentFile().getParentFile().getParentFile();
                } else {
                    throw new UnexpectedException("Cannot find the Play! framework - trying with uri: " + uri + " scheme " + uri.getScheme());
                }
            }
        } catch (Exception e) {
            throw new UnexpectedException("Where is the framework ?", e);
        }
    }
View Full Code Here

                    Logger.error(e, "Can't start in PROD mode with errors");
                }
                if (e instanceof RuntimeException) {
                    throw (RuntimeException) e;
                }
                throw new UnexpectedException(e);
            }

            if (firstStart) {
                Logger.info("Application '%s' is now started !", configuration.getProperty("application.name", ""));
                firstStart = false;
            }

            // We made it
            started = true;
            startedAt = System.currentTimeMillis();

            // Plugins
            pluginCollection.afterApplicationStart();

        } catch (PlayException e) {
            started = false;
            try { Cache.stop(); } catch (Exception ignored) {}
            throw e;
        } catch (Exception e) {
            started = false;
            try { Cache.stop(); } catch (Exception ignored) {}
            throw new UnexpectedException(e);
        }
    }
View Full Code Here

TOP

Related Classes of play.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.