'RTK Query - don't log browser errors to the console

I have used RTK query in my web site. There is one URL endpoint that needs authentication. If the user is not signed int, the HTTP status code is 401 Unauthorized. And hence, GET https://example.com/ 401 is logged to the console.

Chrome lighthouse complains that Browser errors were logged to the console.

How to ignore logging error to the console when App is in production mode?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source