diff --git a/examples/thoughts/src/client/ThoughtsPage.jsx b/examples/thoughts/src/client/ThoughtsPage.jsx index 5df2667f51..6441ae8082 100644 --- a/examples/thoughts/src/client/ThoughtsPage.jsx +++ b/examples/thoughts/src/client/ThoughtsPage.jsx @@ -12,7 +12,9 @@ const ThoughtsPage = (props) => { const tag = queryParams.get('tag') // TODO: Handle possible errors and fetching. - const { data: thoughts } = useQuery(getThoughts, { tagName: tag }) + const { error, status, data: thoughts } = useQuery(getThoughts, { tagName: tag }) + + console.log('Error: ' + JSON.stringify(error)); return ( { activeTag={tag || '_all'} >
+ Status: {status}
diff --git a/examples/thoughts/src/server/queries.js b/examples/thoughts/src/server/queries.js index a5394d91de..2e7bd68ebc 100644 --- a/examples/thoughts/src/server/queries.js +++ b/examples/thoughts/src/server/queries.js @@ -1,6 +1,7 @@ import { HttpError } from "wasp/server"; export const getThoughts = async (args, context) => { + throw new HttpError(404); if (!context.user) { throw new HttpError(403) } return context.entities.Thought.findMany({