Start renaming

This commit is contained in:
2026-11-11 11:45:20 -03:00
parent ae22ec5276
commit 216d54a0ae
179 changed files with 890 additions and 449 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ Fresh supports two kind of error pages:
To add an error page use [`app.onError()`](/docs/concepts/app#onerror).
```ts main.ts
import { App } from "fresh";
import { App } from "sweet";
const app = new App()
.onError("*", (ctx) => {
@@ -77,13 +77,13 @@ If you need to bail out of execution and need to respond with a particular HTTP
error code, you can use Fresh's `HttpError` class:
```ts
import { HttpError } from "fresh";
import { HttpError } from "sweet";
```
`HttpError` takes a status code and an optional message:
```ts middleware/auth.ts
import { HttpError } from "fresh";
import { HttpError } from "sweet";
async function authMiddleware(ctx) {
const user = ctx.state.user;
@@ -106,7 +106,7 @@ When an `HttpError` is thrown, Fresh catches it and invokes the error handler.
You can check the status code in your error handler:
```ts
import { HttpError } from "fresh";
import { HttpError } from "sweet";
app.onError("*", (ctx) => {
if (ctx.error instanceof HttpError) {