Description
The error message when loading the config file in the API server is misleading. It currently says "Config file {path} does not exist", but the actual failure can be due to multiple reasons, including YAML schema mismatches.
Example
When there's a YAML schema mismatch, the error message is:
Error: Config file /etc/clp-config.yaml does not exist
Caused by:
0: `serde_yaml::Error`: stream_output: unknown variant `profile`, expected `credentials` at line 85 column 3
1: stream_output: unknown variant `profile`, expected `credentials` at line 85 column 3
The file exists, but the schema is invalid. The message should be more generic, such as "Failed to load config file" to avoid confusion.
Location
components/api-server/src/bin/api_server.rs lines 31-33
Related Links
Requested by: @junhaoliao
Description
The error message when loading the config file in the API server is misleading. It currently says "Config file {path} does not exist", but the actual failure can be due to multiple reasons, including YAML schema mismatches.
Example
When there's a YAML schema mismatch, the error message is:
The file exists, but the schema is invalid. The message should be more generic, such as "Failed to load config file" to avoid confusion.
Location
components/api-server/src/bin/api_server.rslines 31-33Related Links
Requested by: @junhaoliao