Exclusive 22% OFF All Quantra by QuantInsti Courses for IBridgePy Users Master algorithmic trading from beginner to advanced — Python for trading, machine learning strategies, options trading, and more.
HUI22 Use HUI22 for 22% off
HUI7 Stack HUI7 for an additional 7% off
Browse Courses →
← Back to Blog

Is it possible to ignore or block error messages?

June 15, 2017

Learning to ignore or block error messages in IBridgePy should be approached carefully as these messages are crucial for algorithmic trading debugging. While possible to ignore block error notifications, keeping error messages visible helps you troubleshoot issues with the IB API connection and order execution.

Ignore or block error messages in IBridgePy debugging

It is possible to ignore or block error messages in IBridgePy but it is NOT recommended to do so because you may miss some of the most important information from IB. Also, you may need to see the error messages to debug your codes.

How to Block Error Messages in IBridgePy

Anyway, if you really really want to do so, you can do that in IBridgePy. Go to the folder where you save IBridgePy and get into the folder of IBridgePy. Open IBAccountManager.py and look for def error(self, errorId, errorCode, errorString). Replace the whole function content by “pass”, which means that do nothing in this function. Then, you won’t see any error messages any more. For better debugging, review our documentation.

Learn more from Python official documentation.