Description
I have noticed that the execute method in the MondayGraphQL class within the graphql_handler.py module uses print statements for logging and does not raise exceptions when errors occur. This can lead to difficulties in debugging and maintaining integrations that rely on this method.
Steps to Reproduce
- Call the execute method with parameters that cause an error (e.g., invalid query).
- Observe that the error is printed to the console instead of being logged or raised as an exception.
Expected Behavior
- Error messages should be logged using the logging module.
- Proper exceptions should be raised to allow for better error handling in user code.
Proposed Solution
-
Use the logging module:
- Replace all
print statements with appropriate logging calls (e.g., logger.info, logger.error).
-
Raise Exceptions:
- Instead of printing error messages, raise exceptions to allow the calling code to handle them appropriately.
Benefits
- Improved error handling: Users can catch and handle exceptions in their code.
- Better logging: Users can configure logging levels and outputs as needed.
Thank you for considering these improvements.