Uploaded image for project: 'VOLTHA'
  1. VOLTHA
  2. VOL-4449

Common error variables

    XMLWordPrintable

    Details

    • Story Points:
      3

      Description

      Currently we have code similar to the following sprinkled throughout the project

      return errors.New("foo-not-found")

      or

      return fmt.Errorf("some error: %s", err)

      This really should be cleaned up so that we define some common errors that are used throughout the code, i.e

      var ErrNotFound = errors.New("not-found")

      as well as we should start using error wrapping

       

      return fmt.Errorf("some context: %w")

      errors.Is()

       

      with respect to common errors, there is an assumption that a common "not-found" is just as good as a specific "foo-not-found" as the code that logs the error should (a) be determining what needs to be logged and (b) the unwrapping should give the appropriate context.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            dbainbri David Bainbridge
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes