mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-18 01:57:02 +00:00
Missing message is now 404 instead of 500
- Added smtpd.ErrNotExist to make detecting missing message easier - Return 404 instead of 500 when requesting a non-extistant message - More REST unit tests
This commit is contained in:
@@ -120,6 +120,10 @@ func MailboxShow(w http.ResponseWriter, req *http.Request, ctx *Context) (err er
|
||||
return fmt.Errorf("MailboxFor('%v'): %v", name, err)
|
||||
}
|
||||
msg, err := mb.GetMessage(id)
|
||||
if err == smtpd.ErrNotExist {
|
||||
http.NotFound(w, req)
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("GetMessage() failed: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user