You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by aledsage <gi...@git.apache.org> on 2015/11/12 21:43:49 UTC

[GitHub] incubator-brooklyn pull request: BROOKLYN-144: avoid err when pers...

GitHub user aledsage opened a pull request:

    https://github.com/apache/incubator-brooklyn/pull/1026

    BROOKLYN-144: avoid err when persisting ha-record

    - Adds Exception.propagate(msg, throwable) so can include info about
      the file that could not be created.
    - Fix FileUtil.setFilePermissions so that createNewFile creates the
      parent directory if necessary.
    - HighAvailabilityManager’s polling task: log.err on first exception,
      then log.debug for subsequent consecutive exceptions.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/aledsage/incubator-brooklyn fix/brooklyn-144

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-brooklyn/pull/1026.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1026
    
----
commit 315babf59cdf7206c7f8aac129a3454e5d82c4b6
Author: Aled Sage <al...@gmail.com>
Date:   2015-11-12T20:42:39Z

    BROOKLYN-144: avoid err when persisting ha-record
    
    - Adds Exception.propagate(msg, throwable) so can include info about
      the file that could not be created.
    - Fix FileUtil.setFilePermissions so that createNewFile creates the
      parent directory if necessary.
    - HighAvailabilityManager’s polling task: log.err on first exception,
      then log.debug for subsequent consecutive exceptions.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: BROOKLYN-144: avoid err when pers...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-brooklyn/pull/1026


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: BROOKLYN-144: avoid err when pers...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1026#issuecomment-156296274
  
    LGTM


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-brooklyn pull request: BROOKLYN-144: avoid err when pers...

Posted by ahgittin <gi...@git.apache.org>.
Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/1026#discussion_r44742931
  
    --- Diff: utils/common/src/test/java/org/apache/brooklyn/util/exceptions/ExceptionsTest.java ---
    @@ -59,6 +59,28 @@ public void testPropagateCheckedException() throws Exception {
         }
         
         @Test
    +    public void testPropagateCheckedExceptionWithMessage() throws Exception {
    +        String extraMsg = "my message";
    +        Exception tothrow = new Exception("simulated");
    +        try {
    +            throw Exceptions.propagate(extraMsg, tothrow);
    +        } catch (RuntimeException e) {
    +            assertEquals(e.getMessage(), "my message");
    +            assertEquals(e.getCause(), tothrow);
    +        }
    +    }
    +    
    +    @Test
    +    public void testPropagateRuntimeExceptionIgnoresMessage() throws Exception {
    +        NullPointerException tothrow = new NullPointerException("simulated");
    +        try {
    +            throw Exceptions.propagate("my message", tothrow);
    --- End diff --
    
    see `Asserts.shouldHaveFailedPreviously()` (useless in this simple case but i find it makes this type of test more readable)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---