File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,17 @@ func LoadConfig(configPath string) (*EntraidConfig, error) {
4545 file , err := os .Open (configPath )
4646 if err != nil {
4747 file , err = os .Open ("endpoints.json" )
48- }
49-
50- if err == nil {
51- defer file .Close ()
52- decoder := json .NewDecoder (file )
53- err = decoder .Decode (& config .Endpoints )
5448 if err != nil {
55- return nil , err
49+ return nil , fmt . Errorf ( "failed to open configuration file: %v" , err )
5650 }
5751 }
5852
53+ defer file .Close ()
54+ decoder := json .NewDecoder (file )
55+ err = decoder .Decode (& config .Endpoints )
56+ if err != nil {
57+ return nil , fmt .Errorf ("failed to decode configuration file: %v" , err )
58+ }
5959 // Override with environment variables if they exist
6060 if envClientID := os .Getenv ("AZURE_CLIENT_ID" ); envClientID != "" {
6161 config .AzureClientID = envClientID
You can’t perform that action at this time.
0 commit comments