brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahgittin <>
Subject [GitHub] incubator-brooklyn pull request: CLI commands for manipulating cat...
Date Mon, 25 May 2015 08:31:08 GMT
Github user ahgittin commented on a diff in the pull request:
    --- Diff: utils/common/src/main/java/brooklyn/util/javalang/ ---
    @@ -44,7 +46,15 @@ public static boolean removeShutdownHook(Thread hook) {
                 return Runtime.getRuntime().removeShutdownHook(hook);
             } catch (IllegalStateException e) {
                 // probably shutdown in progress
    -            log.debug("cannot remove shutdown hook "+hook+": "+e);
    +            String text = Exceptions.collapseText(e);
    +            if (text.contains("Shutdown in progress")) {
    --- End diff --
    i'd prefer a typed exception here, but the exception is thrown by java, not us, if you
try to add a shutdown hook while a shutdown is in progress; this is just trying to clean up
the log messages which are shown at the tail of the log on a shutdown
    nothing against typed exceptions where useful but in general paths which might want typed
exception handling i prefer the error-listener / callback pattern, avoiding throwing altogether
-- for instance `Maybe.absentThrowing` and `ReferenceWithError`.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message