Skip to content

Commit e99e998

Browse files
committed
Add error handling for missing config file in load_config
1 parent 6c7e2d4 commit e99e998

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

pyrogram/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,9 @@ async def handle_updates(self, updates):
666666
log.info(updates)
667667

668668
async def load_config(self):
669+
if not os.path.isfile(self.config_file):
670+
raise FileNotFoundError(f"The configuration file at {self.config_file} does not exist.")
671+
669672
async with aiofiles.open(self.config_file, mode='r') as file:
670673
contents = await file.read()
671674

0 commit comments

Comments
 (0)