Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Commit

Permalink
feat: Add default message for kAXErrorFailure
Browse files Browse the repository at this point in the history
Based on apple's documentation, all functions can return kAXErrorFailure due to sytem memory failure.
https://developer.apple.com/documentation/applicationservices/axuielement_h
  • Loading branch information
daveenguyen committed Oct 3, 2019
1 parent 6a2d7f9 commit 3559d38
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion atomacos/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def check_ax_error(error_code, error_messages):
try:
error_message = error_messages[error_code]
except KeyError:
error_message = "Unknown AX Error: %s" % error_code
if error_code == kAXErrorFailure:
error_message = "There is some sort of system memory failure"
else:
error_message = "Unknown AX Error: %s" % error_code

raise AXErrorFactory(error_code)(error_message)

0 comments on commit 3559d38

Please sign in to comment.