Skip to content

[WIP] [Core] Propose minimal error handling methodology #519

@bryanchriswhite

Description

@bryanchriswhite

Objective

Consistent and ubiquitous error handling methodology. Concerns:

  • Testing
    • Asserting specific error cases using high-level APIs (i.e. not using regular expressions to match error messages, etc.)
  • Logging
    • Debugging
      • Convenient access to stack traces (e.g. print stack trace of errors on DEBUG level)
  • Errors sent over the network
    • Can't leak metadata (e.g. peer's shouldn't see a detailed DB error from one another)

Origin Document

image

Goals

  • Improve accuracy and maintainability of error case test code.
  • Improve developer experience while debugging.
  • Improve readability and consistency in error handling logic across the codebase.
  • Ensure consistency in error presentation.
  • Ensure errors sent over the network can't leak metadata.

Deliverable

  • Proposal for a minimal, coherent error framework which addresses the outlined concerns
    • Defines "proper presentation" for:
      • logging
      • end-user (i.e. normal operation, not debugging)
      • debugging
  • Documentation of a minimal, example application of the methodology which covers each concern (see "Testing Methodology", below).

Non-goals / Non-deliverables

  • Changing existing error handling code.

Testing Methodology

  1. Write an simple, example test which asserts for a specific error.
  2. Ensure proper presentation when running tests.
  3. Write a simple, example script which generates and logs the error but then exits normally.
  4. Ensure proper presentation when logging.
  5. Update the script to make the error fatal.
  6. Ensure proper presentation while debugging.

Creator: @bryanchriswhite

Metadata

Metadata

Labels

coreCore infrastructure - protocol relateddiscussionIt has a related Discussiontoolingtooling to support development, testing et al

Type

No type

Projects

Status

Backlog

Relationships

None yet

Development

No branches or pull requests

Issue actions