Package org.b3log.latke.event

Examples of org.b3log.latke.event.EventException


                blogSyncCnBlogs = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_CNBLOGS, blogSyncCnBlogs);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = updateArticle(event);
            try {
                blogSyncCnBlogs.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here


                blogSyncCnBlogs = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_CNBLOGS, blogSyncCnBlogs);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = removeArticle(event);
            try {
                blogSyncCnBlogs.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here

                blogSyncBlogJava = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_BLOGJAVA, blogSyncBlogJava);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = addArticle(event);
            try {
                blogSyncBlogJava.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here

                blogSyncBlogJava = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_BLOGJAVA, blogSyncBlogJava);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = updateArticle(event);
            try {
                blogSyncBlogJava.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here

                blogSyncBlogJava = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_BLOGJAVA, blogSyncBlogJava);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = removeArticle(event);
            try {
                blogSyncBlogJava.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncBlogJava.put(Keys.CODE,
                                     BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncBlogJava.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here

                blogSyncCnBlogs = new JSONObject();
                events.put(BlogSync.BLOG_SYNC_CNBLOGS, blogSyncCnBlogs);
            }
        } catch (final JSONException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            throw new EventException(e);
        }

        try {
            final JSONObject rslt = addArticle(event);
            try {
                blogSyncCnBlogs.put(Keys.CODE, rslt.getString(Keys.STATUS_CODE));
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final SyncException e) {
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, e.getMessage());
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        } catch (final EventException e) {
            LOGGER.log(Level.SEVERE, e.getMessage(), e);
            try {
                blogSyncCnBlogs.put(Keys.CODE,
                                    BlogSyncStatusCodes.BLOG_SYNC_FAIL);
                blogSyncCnBlogs.put(Keys.MSG, "Unknown exception :-(");
            } catch (final JSONException ex) {
                LOGGER.log(Level.SEVERE, ex.getMessage(), ex);
                throw new EventException(ex);
            }
        }
    }
View Full Code Here

    @Override
    public void action(final Event<JSONObject> event) throws EventException {
        final JSONObject preference = preferenceUtils.getPreference();
        if (null == preference) {
            throw new EventException("Not found preference");
        }

        final boolean enabled = preference.optBoolean(
                Preference.ENABLE_POST_TO_TENCENT_MICROBLOG);
        if (!enabled) {
View Full Code Here

TOP

Related Classes of org.b3log.latke.event.EventException

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.