Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

errors: Support multierr and pkg/errors' causer #460

Merged
merged 3 commits into from
Jun 30, 2017
Merged

Commits on Jun 30, 2017

  1. errors: Support multierr and pkg/errors' causer

    This changes how we log errors to break down multierr and pkg/errors
    errors if possible.
    
    If an error is a multierr error, its individual items will be listed
    under `${key}Causes` as objects. Roughly,
    
        "error": "foo; bar; baz",
        "errorVerbose":
            `the following errors occurred:
              -  foo
              -  bar
              -  baz`,
        "errorCauses": [
            {"error": "foo"},
            {"error": "bar"},
            {"error": "baz"},
        ]
    
    Similarly, if an error is a pkg/errors causer, the cause will be listed
    under `${key}Causes` by itself.
    
        "error": "foo: bar",
        "errorVerbose": "foo: bar\n[stack trace]"
        "errorCauses": [
            {
                "error": "bar",
                "errorVerbose": "bar\n[stack trace]",
            },
        ]
    
    See: uber-go/multierr#6
    abhinav committed Jun 30, 2017
    Configuration menu
    Copy the full SHA
    b4c80c0 View commit details
    Browse the repository at this point in the history
  2. Explanatory comment

    abhinav committed Jun 30, 2017
    Configuration menu
    Copy the full SHA
    2f1a926 View commit details
    Browse the repository at this point in the history
  3. Release() => Free()

    abhinav committed Jun 30, 2017
    Configuration menu
    Copy the full SHA
    506766d View commit details
    Browse the repository at this point in the history