Comments (3)
Currently the 1st "basic usage" example works fully, but if it's forced to decode JSON with a syntax error the promise rejection is eaten up silently... investigating next.
from fetch.
This is harder than I thought it would be.
from fetch.
The entire codebase is greatly improved and tidy now, with more type safety, but this issue still remains as the only known bug.
Fetch/src/Response/BodyResponse.php
Lines 113 to 131 in 144cedb
This is where the issue lies, in the resolution of the JSON data. If the JSON data is invalid, like it is when used in example/01-basic-fetch.php
, the exception is thrown rather than passed up the promise chain.
It's actually not a breaking issue, because it only represents internal failures (things like curl exceptions, timeouts or when $response->ok fails, are all still caught correctly). It might make sense to release the code in its currently improved state, then track this issue in a separate issue to return to later.
from fetch.
Related Issues (20)
- Internal errors parsing response are not triggering "catch" functions HOT 2
- Curl and CurlMulti interfaces. HOT 1
- PSR-7 compatibility HOT 1
- Body stream is empty!
- Use Http/Promise interface
- BodyResponse promise is not resolving HOT 3
- PSR-18 HOT 3
- Difference between blob/text ? HOT 1
- FormData to send data using x-www-form-urlencoded HOT 1
- Json response object improvement
- Json->getStdClass()
- Stress test and concurrency limit
- fetch() and fetchAwait() functions
- Init parameters on the server-side
- Cache modes
- Subresource integrity
- AbortSignal init parameter
- Dependabot
- FormData type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fetch.