Skip to content

Call stack incorrect when handling an error that was thrown using throwByErr after a call to .then #31505

Open
@ryanthemanuel

Description

@ryanthemanuel

Current behavior

The call stack displayed in the app is incorrect when displaying an error that was thrown by the function throwByErr and the error occurs right after a call to then.

Desired behavior

The call stack should match the code that caused the problem.

Test code to reproduce

There are a few examples:

    cy.window().then((win) => {
      expect(1).to.equal(1)
    })
    cy.get('div').click()
Image
      cy.request('https://jsonplaceholder.cypress.io/comments').then((response) => {
        expect(response.status).to.eq(200)
      })
      cy.task()
      cy.request().then((response) => {
        expect(response.status).to.eq(200)
      })
Image

Cypress Version

At least since version 10

Node version

any

Operating System

any

Debug Logs

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions