Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

handle async route errors #488

Merged
merged 2 commits into from
Oct 25, 2018
Merged

Conversation

nikku
Copy link
Contributor

@nikku nikku commented Oct 20, 2018

Related to #487

@nikku
Copy link
Contributor Author

nikku commented Oct 20, 2018

This improves the situation described in #487, as it makes sure that errors in async routes are actually caught. It only really improves direct access to the .json file though.

If the file is consumed via this.fetch during preloading it will now complain about fetch returning invalid JSON. It returns the actual error text.

FetchError: invalid json response body at http://127.0.0.1:3000/index.json reason: Unexpected token O in JSON at position 0
    at eval (webpack:///./__sapper__/server.js?:810:32)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

@Rich-Harris Rich-Harris merged commit 3fe7b55 into sveltejs:master Oct 25, 2018
@Rich-Harris
Copy link
Member

nice, thank you!

@nikku nikku deleted the 487-async-route-errors branch October 25, 2018 06:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants