I wonder if there is a nice way to wrap these types of errors with an exception. As written we cannot catch errors like these and the interpreter will crash. Below is an example of trying to fetch the size of a bad window id.
$ python
>>> import xdo
>>> x = xdo.Xdo()
>>> x.get_window_size(123)
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x7b
Serial number of failed request: 17
Current serial number in output stream: 18
$
I wonder if there is a nice way to wrap these types of errors with an exception. As written we cannot catch errors like these and the interpreter will crash. Below is an example of trying to fetch the size of a bad window id.