mirror of
https://github.com/miniflux/v2.git
synced 2025-08-11 17:51:01 +00:00
Refactor HTTP Client and LocalizedError packages
This commit is contained in:
parent
120aabfbce
commit
14e25ab9fe
104 changed files with 1277 additions and 10672 deletions
|
@ -7,7 +7,7 @@ import (
|
|||
"net/http"
|
||||
"strings"
|
||||
|
||||
"miniflux.app/v2/internal/errors"
|
||||
"miniflux.app/v2/internal/locale"
|
||||
)
|
||||
|
||||
// AuthForm represents the authentication form.
|
||||
|
@ -17,9 +17,9 @@ type AuthForm struct {
|
|||
}
|
||||
|
||||
// Validate makes sure the form values are valid.
|
||||
func (a AuthForm) Validate() error {
|
||||
func (a AuthForm) Validate() *locale.LocalizedError {
|
||||
if a.Username == "" || a.Password == "" {
|
||||
return errors.NewLocalizedError("error.fields_mandatory")
|
||||
return locale.NewLocalizedError("error.fields_mandatory")
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue