Use a generic exception in _check_call.

This fixes #291.  Would a different base class for the exception be more appropriate?