MCPcopy
hub / github.com/vercel/next.js / Test5

Function Test5

examples/with-sentry/pages/client/test5.tsx:3–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import * as Sentry from "@sentry/nextjs";
2
3const Test5 = () => (
4 <>
5 <h1>Client Test 5</h1>
6 <button
7 onClick={() => {
8 const transaction = Sentry.startTransaction({
9 name: "Testing performance",
10 });
11 Sentry.configureScope((scope) => {
12 scope.setSpan(transaction);
13 });
14
15 try {
16 // Some operation the button does, but fails
17 throw new Error("Client Test 5");
18 } catch (error) {
19 Sentry.captureException(error);
20 } finally {
21 transaction.finish();
22 }
23 }}
24 >
25 Click me to create a transaction and throw an Error
26 </button>
27 </>
28);
29
30export default Test5;

Callers

nothing calls this directly

Calls 1

finishMethod · 0.65

Tested by

no test coverage detected