throw error instead of console.error