Skip to content

Errors and I18N #52

Description

@angrynode

Current error design mixes semantic errors ("no such content folder", "duplicate torrent ID") with transient/global errors ("IO error", "DB error"). There's a few limitations:

  • using snafu, we need to provide a string representation for the error
  • but can't translate the error in different languages
  • can't really distinguish where unwrapping makes sense or not

We could use a pattern like:

  • more liberal use of unwraps (eg. for DB IO) with a panic catching middleware to display an "internal server error" because DB errors should not happen
  • global, unrecoverable errors are still expressed as AppStateError and displayed full page
  • maybe templates have more specific error types?

Maybe we'd want AppStateError to be serializable to a cookie, which excludes IO errors (among others), for helping with FlashRedirect.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions