Commit c8f695a4 authored by Leon's avatar Leon Committed by Sietse Ringers
Browse files

Display more specific error message when non-optional attributes are missing + fix typo

parent aec88e0f
...@@ -190,16 +190,16 @@ func (s *Server) StartSession(req interface{}) (*irma.Qr, string, error) { ...@@ -190,16 +190,16 @@ func (s *Server) StartSession(req interface{}) (*irma.Qr, string, error) {
request := rrequest.SessionRequest() request := rrequest.SessionRequest()
action := request.Action() action := request.Action()
if err := s.validateRequest(request); err != nil {
return nil, "", err
}
if action == irma.ActionIssuing { if action == irma.ActionIssuing {
if err := s.validateIssuanceRequest(request.(*irma.IssuanceRequest)); err != nil { if err := s.validateIssuanceRequest(request.(*irma.IssuanceRequest)); err != nil {
return nil, "", err return nil, "", err
} }
} }
if err := s.validateRequest(request); err != nil {
return nil, "", err
}
session := s.newSession(action, rrequest) session := s.newSession(action, rrequest)
s.conf.Logger.WithFields(logrus.Fields{"action": action, "session": session.token}).Infof("Session started") s.conf.Logger.WithFields(logrus.Fields{"action": action, "session": session.token}).Infof("Session started")
if s.conf.Logger.IsLevelEnabled(logrus.DebugLevel) { if s.conf.Logger.IsLevelEnabled(logrus.DebugLevel) {
......
...@@ -487,7 +487,7 @@ func (cr *CredentialRequest) Validate(conf *Configuration) error { ...@@ -487,7 +487,7 @@ func (cr *CredentialRequest) Validate(conf *Configuration) error {
} }
} }
if !found { if !found {
return errors.New("Credential request contaiins unknown attribute") return errors.New("Credential request contains unknown attribute")
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment