Avoid sending invalid error message to console