Skip to content

Commit

Permalink
feat(safety-net): Add improved documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
briward committed Nov 13, 2024
1 parent 6e25b29 commit ec6b244
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,11 @@ You can create your own errors by implementing the `Error` interface.
If you prefer to manage errors manually, you can disable the automatic error catching feature in the Kernel options. When you do this, it's essential to add a middleware callback (see example below) to check for errors and handle the responses accordingly.

```ts
import { type Context, Kernel, NotFound } from "jsr:@raptor/framework";

const app = new Kernel({
catchErrors: false,
})
```

```ts
import { type Context, NotFound } from "jsr:@raptor/framework";
});

// Simulate an application error.
app.add((context: Context) => {
Expand All @@ -166,6 +164,8 @@ app.add((context: Context) => {
message: 'There was an internal server error'
}
});

app.serve({ port: 8000 });
```

# Deployment
Expand Down

0 comments on commit ec6b244

Please sign in to comment.