-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(remix): Capture thrown fetch responses.
- Loading branch information
1 parent
4f44046
commit 1bb2b1c
Showing
6 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/remix/test/integration/app_v1/routes/loader-throw-response/$id.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from '../../../common/routes/loader-throw-response.$id'; | ||
export { default } from '../../../common/routes/loader-throw-response.$id'; |
2 changes: 2 additions & 0 deletions
2
packages/remix/test/integration/app_v2/routes/loader-throw-response.$id.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from '../../common/routes/loader-throw-response.$id'; | ||
export { default } from '../../common/routes/loader-throw-response.$id'; |
24 changes: 24 additions & 0 deletions
24
packages/remix/test/integration/common/routes/loader-throw-response.$id.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { LoaderFunction } from '@remix-run/node'; | ||
import { useLoaderData } from '@remix-run/react'; | ||
|
||
export const loader: LoaderFunction = async ({ params: { id } }) => { | ||
if (id === '-1') { | ||
throw new Response(null, { | ||
status: 500, | ||
statusText: 'Not found', | ||
}); | ||
} | ||
|
||
return { message: 'hello world' }; | ||
}; | ||
|
||
export default function LoaderThrowResponse() { | ||
const data = useLoaderData(); | ||
|
||
return ( | ||
<div> | ||
<h1>Loader Throw Response</h1> | ||
<span>{data ? data.message : 'No Data'} </span> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters