How to add validation in pre-request and fail test based on pre-request condition



I want to write a condition in pre-request.
Such that, If that pre-request condition is satisfied, then only we should hit the API and validate it.
Else, it should fail the test without hitting the API and continue to the next test.

For ex:
In pre-request, there might be condition to check if global variable ‘new’ == ‘true’ if so then hit the api and validate assertions in Tests. But if its ‘new’ != ‘true’ then fail the current test without even hitting the api and continue to next test case.

if (new === "true" ){
pm.globals.set("test_key_value", "variable_value");
throw "Failing the Test and Moving to next test case";

I tried using throw as above but its giving me below error:
There was an error in evaluating the Pre-request Script: Error: Entity values do not match