Added error handling to pet creation

console.error