nit: I think you can use %s in console.error for better readability