File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -219,18 +219,22 @@ def load_custom_sdkconfig_file():
219
219
response = requests .get (file_entry .split (" " )[0 ])
220
220
if response .ok :
221
221
return response .content .decode ('utf-8' )
222
- except Exception as e :
222
+ except requests . RequestException as e :
223
223
print (f"Error downloading { file_entry } : { e } " )
224
+ except UnicodeDecodeError as e :
225
+ print (f"Error decoding response from { file_entry } : { e } " )
224
226
return ""
225
227
226
228
# Handle local files
227
229
if "file://" in file_entry :
228
- file_path = join (PROJECT_DIR , file_entry .lstrip ("file://" ).split (os .path .sep )[- 1 ])
230
+ file_ref = file_entry [7 :] if file_entry .startswith ("file://" ) else file_entry
231
+ filename = os .path .basename (file_ref )
232
+ file_path = join (PROJECT_DIR , filename )
229
233
if os .path .exists (file_path ):
230
234
try :
231
235
with open (file_path , 'r' ) as f :
232
236
return f .read ()
233
- except Exception as e :
237
+ except IOError as e :
234
238
print (f"Error reading file { file_path } : { e } " )
235
239
return ""
236
240
else :
You can’t perform that action at this time.
0 commit comments