Skip to content

Commit ec6b244

Browse files
committed
feat(safety-net): Add improved documentation.
1 parent 6e25b29 commit ec6b244

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,11 @@ You can create your own errors by implementing the `Error` interface.
137137
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.
138138

139139
```ts
140+
import { type Context, Kernel, NotFound } from "jsr:@raptor/framework";
141+
140142
const app = new Kernel({
141143
catchErrors: false,
142-
})
143-
```
144-
145-
```ts
146-
import { type Context, NotFound } from "jsr:@raptor/framework";
144+
});
147145

148146
// Simulate an application error.
149147
app.add((context: Context) => {
@@ -166,6 +164,8 @@ app.add((context: Context) => {
166164
message: 'There was an internal server error'
167165
}
168166
});
167+
168+
app.serve({ port: 8000 });
169169
```
170170

171171
# Deployment

0 commit comments

Comments
 (0)