Closed lovasoa closed 2 years ago
I'll check if there is any way to get meaningful errors out of serde but this is currently opaque - the code asks serde to load and it either does or it doesn't.
Yes, serde gives meaningful errors, that could be returned to the user, potentially wrapped in a custom error type. Also, serde_yaml can read a file directly, no need to read it to a string first: https://docs.rs/serde_yaml/latest/serde_yaml/fn.from_reader.html
For now I've added code to log the error message that serde gives me into the error output
When a configuration file cannot be deserialized, this is the only thing that is logged:
And the
ServerConfig::load
returnsErr(())
, so there is no way to know where the error is in the invalid configuration file.