Skip to content

Commit ce6b8ab

Browse files
committed
test: use HTTPError
1 parent 2efd5f4 commit ce6b8ab

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

test/tracing.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { tracingChannel } from "node:diagnostics_channel";
33
import { describeMatrix, type TestOptions } from "./_setup.ts";
44
import { H3 } from "../src/h3.ts";
55
import { tracingPlugin, type H3THandlerTracePayload } from "../src/tracing.ts";
6+
import { HTTPError } from "../src/error.ts";
67

78
type TracingEvent = {
89
start?: { data: H3THandlerTracePayload };
@@ -167,7 +168,7 @@ describeMatrix(
167168

168169
try {
169170
t.app.get("/error", () => {
170-
throw new Error("Handler error");
171+
throw new HTTPError("Handler error");
171172
});
172173

173174
await t.fetch("/error");
@@ -763,7 +764,7 @@ describeMatrix(
763764

764765
try {
765766
const errorFetchHandler = (_: Request) => {
766-
throw new Error("Fetch handler error");
767+
throw new HTTPError("Fetch handler error");
767768
};
768769

769770
t.app.mount("/error-fetch", errorFetchHandler);

0 commit comments

Comments
 (0)