Commit 8d9e7f2b authored by ale's avatar ale

Improve error reporting

And fix a bug with inline XML descriptors.
parent 1df6f233
Pipeline #4095 passed with stages
in 3 minutes and 21 seconds
......@@ -42,15 +42,15 @@ func main() {
config, err := loadConfig()
if err != nil {
log.Fatal(err)
log.Fatalf("error loading configuration: %v", err)
}
s, err := saml.NewSAMLIDP(config.SAMLConfig)
if err != nil {
log.Fatal(err)
log.Fatalf("error instantiating SAML IDP: %v", err)
}
if err := serverutil.Serve(s, config.ServerConfig, *addr); err != nil {
log.Fatal(err)
log.Fatalf("error: %v", err)
}
}
......@@ -88,12 +88,14 @@ func (c *Config) loadServiceProviders() error {
var err error
data, err = ioutil.ReadFile(sp.Descriptor[1:])
if err != nil {
return err
return fmt.Errorf("reading %s: %v", sp.Descriptor[1:], err)
}
} else {
data = []byte(sp.Descriptor)
}
var ent saml.EntityDescriptor
if err := xml.Unmarshal(data, &ent); err != nil {
return err
return fmt.Errorf("error unmarshaling descriptor: %v", err)
}
sp.parsed = &ent
c.serviceProviderMap[ent.EntityID] = sp
......
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