Skip to content

withServerActionInstrumentation catches NEXT_REDIRECT and NEXT_NOT_FOUND errors #10466

Closed
@ianschmitz

Description

@ianschmitz

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/nextjs

SDK Version

7.99.0

Framework Version

14.1.0

Link to Sentry event

https://yellowpad-tl.sentry.io/issues/4933611798/events/b027a0b732e44edfa4da10f4f6d528fa/?project=4506667113185280

SDK Setup

{
    dsn: "https://ab637fbc48e826363f3cc7fbb1e0fc68@o4506114868117504.ingest.sentry.io/4506667113185280",
    tracesSampleRate: 1,
    debug: false,
}

Steps to Reproduce

Create a server action with the following:

"use server";

import { withServerActionInstrumentation } from "@sentry/nextjs";
import { headers } from "next/headers";

export async function someAction() {
  return await withServerActionInstrumentation(
      "foo",
      { headers: headers() },
      async () => {
          redirect("/some-path");
      },
  );
}

Expected Result

These exceptions should not be caught as per #7641.

Actual Result

An error is logged in Sentry issues:

CleanShot 2024-02-01 at 11 13 21

Metadata

Metadata

Assignees

No one assigned

    Labels

    Package: nextjsIssues related to the Sentry Nextjs SDK

    Type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions