Skip to content

Commit 583c840

Browse files
committed
wording
1 parent 963c2f5 commit 583c840

File tree

1 file changed

+4
-3
lines changed
  • remix/lessons/04-responses-and-errors/lecture

1 file changed

+4
-3
lines changed

remix/lessons/04-responses-and-errors/lecture/NOTES.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Lecture Notes
22

33
```ts
4-
// If you want to respond to the component from a loader or action
5-
// with a non-200 error, you just use json() and set the http status
4+
// "RETURN" goes to component:
5+
return new Response('Invalid Data', { status: 400 })
66
return json({ error: 'Invalid Data' }, { status: 400 })
77

8-
// If you throw a response, the nearest error handler catches it
8+
// "THROW" goes to Error Boundary
99
throw new Response('Not found', { status: 404 })
10+
throw json('Not found', { status: 404 })
1011
```
1112

1213
Docs: Remix will automatically catch errors and render the nearest error boundary for errors thrown while:

0 commit comments

Comments
 (0)