# Why is request status 400 not considered as failed?

**URL:** <https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618>\
**Category:** Help Hub\
**Tags:** just-getting-started, postman-flows\
**Created:** [June 25, 2024, 1:43pm UTC](https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618 "2024-06-25T13:43:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jens-spaeth](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jens-spaeth](https://community.postman.com/u/jens-spaeth)\
**Post date:** [June 25, 2024, 1:43pm UTC](https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618/1 "2024-06-25T13:43:48Z")

</div>

Hi,

why does flows evaluate a 400 Bad Request not as failed?

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/8/08315865a7cf4f4525863d12c2f9ba4078a60088.png)

---

<div class="post-metadata">

**Author:** ![flows-daniel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/flows-daniel/32/25516_2.png) [@flows-daniel](https://community.postman.com/u/flows-daniel)\
**Post date:** [June 25, 2024, 3:38pm UTC](https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618/2 "2024-06-25T15:38:55Z")

</div>

Hi @jens-spaeth

Because you have a passing test it will “pass”(send out of the success port) the block. If you want it to fail you can add a test to expect status 200 (or whatever status you expect).

If you had no tests, then the block should fail.

---

<div class="post-metadata">

**Author:** ![jens-spaeth](https://avatars.discourse-cdn.com/v4/letter/j/9d8465/32.png) [@jens-spaeth](https://community.postman.com/u/jens-spaeth)\
**Post date:** [June 26, 2024, 6:55am UTC](https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618/3 "2024-06-26T06:55:56Z")

</div>

Hi,

if i write a test like this, i can force the block to fail.

```auto
pm.test("Status code should not start with 4 or 5", function () {
    pm.expect(pm.response.code.toString().charAt(0)).to.not.be.oneOf(['4', '5']);
});

```

But for now i don’t need any tests so i opted for removing the one test that was already sitting there.

Thx for the explanation.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [June 29, 2024, 6:56am UTC](https://community.postman.com/t/why-is-request-status-400-not-considered-as-failed/62618/4 "2024-06-29T06:56:08Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
