Please share a minimal working code snippet that reproduces the problem.
Code snippet
```js
const goatRequest = async (link) => {
try {
let response = await cloudscraper.get(link)
} catch (error) {
console.log(error)
}
if (response.statusCode == 200){
console.log(response.body)
}
}
```
When I run the function it prints this in the console
```
(node:2034) UnhandledPromiseRejectionWarning: ReferenceError: response is not defined
at goatRequest
(node:2034) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2034) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```
Please attempt to answer the following questions before submitting a new issue:
cloudscraper@4.5.0
v10.16.3
Whenever i use async/await it doesn't seem to work properly but it works when i use .then functions
https://www.goat.com/web-api/v1/product_variants?productTemplateId=travis-scott-x-air-jordan-1-retro-high-og-cd4487-100'
No, I haven't seen anything on stackoverflow or github
Please share a minimal working code snippet that reproduces the problem.
Code snippet
```js const goatRequest = async (link) => { try { let response = await cloudscraper.get(link) } catch (error) { console.log(error) } if (response.statusCode == 200){ console.log(response.body) } } ``` When I run the function it prints this in the console ``` (node:2034) UnhandledPromiseRejectionWarning: ReferenceError: response is not defined at goatRequest (node:2034) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:2034) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.```