Hi everyone,
After a recent Postman update (I believe sometime around 04/23 2025), it seems that pm.sendRequest
calls in my Pre-request Scripts are now throwing unhandled promise rejections unless they are wrapped in a .catch()
or try/catch
.
, I’m seeing UnhandledPromiseRejection
errors in the console when using pm.sendRequest
in Pre-request Scripts — even though I’m using the classic callback style with (err, res)
.
The problem is that I have a large number of scripts that rely on pm.sendRequest
in its old form (callback-based), and I’m not using async/await
or Promises directly in most of them. The code used to work fine without any explicit error handling for promises.
Now, even simple callback-based requests like this are causing errors:
pm.sendRequest({
url: pm.environment.get('url') + 'example',
method: 'GET'
}, function (err, res) {
if (err) {
console.error(err);
} else {
console.log(res.code);
}
}).catch(console.log); //<<<<<<------ except this make error....
Is this a known change in behavior with a specific Postman version?
Is there a way to suppress or globally handle these unhandled rejection warnings without rewriting every script?
Any suggestions would be greatly appreciated — updating dozens or hundreds of test scripts manually isn’t feasible at the moment.
Thanks!