Throw an error instead of console.log