Only call console.error if it's available