Skip to content

Commit

Permalink
feat: Expose methods to query ErrNoSuchMessage / ErrNoSuchMailbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshoulahan committed Feb 21, 2023
1 parent a4e1a32 commit 15075c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Package gluon implements an IMAP4rev1 (+ extensions) mailserver.
package gluon

import (
"errors"

"github.com/ProtonMail/gluon/internal/state"
)

// IsNoSuchMessage returns true if the error is ErrNoSuchMessage.
func IsNoSuchMessage(err error) bool {
return errors.Is(err, state.ErrNoSuchMessage)
}

// IsNoSuchMailbox returns true if the error is ErrNoSuchMailbox.
func IsNoSuchMailbox(err error) bool {
return errors.Is(err, state.ErrNoSuchMailbox)
}

0 comments on commit 15075c8

Please sign in to comment.