We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d116179 commit 7ec7678Copy full SHA for 7ec7678
1 file changed
BF2AutoSpectator/common/utility.py
@@ -274,12 +274,15 @@ def screenshot_region(
274
config = Config()
275
if config.debug_screenshot():
276
# Save screenshot
277
- cropped.save(
278
- os.path.join(
279
- Config.DEBUG_DIR,
280
- f'screenshot-{datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")}.jpg'
+ try:
+ cropped.save(
+ os.path.join(
+ Config.DEBUG_DIR,
281
+ f'screenshot-{datetime.now().strftime("%Y-%m-%d-%H-%M-%S-%f")}.jpg'
282
+ )
283
)
- )
284
+ except OSError as e:
285
+ logger.error(f'Failed to save screenshot to disk: {e}')
286
287
results.append(cropped)
288
0 commit comments