Comments (2)
This is working fine for me :
const r = await $fetch<string>("http://httpstat.us/500", {
onResponseError({ request, response, options }) {
// Log error
console.log(
"[fetch response error]",
request,
response.status,
response.body
);
},
});
![image](https://private-user-images.githubusercontent.com/13395944/259099845-148ee50a-eb40-4bbb-bdd7-ff2fdfdce168.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTgwMzE5NjIsIm5iZiI6MTcxODAzMTY2MiwicGF0aCI6Ii8xMzM5NTk0NC8yNTkwOTk4NDUtMTQ4ZWU1MGEtZWI0MC00YmJiLWJkZDctZmYyZmRmZGNlMTY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjEwVDE1MDEwMlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUyY2EwOTVlMmFjMzRkZjc0OTk2ODdlYzA3ZmQzNzhhNGI3MGMwZTY4NmQyNjEzNmZmZDIzZWEyNzQ2ZTFiZDgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.3yF41J9jmgoUMaF4-Ryw0xur0l4D1Y_QZtCOW0EHb4M)
from ofetch.
@pi0 I have similar issue in addition to #314
from ofetch.
Related Issues (20)
- Failed to parse response with `json` on `ofetch.raw` HOT 1
- Ability to retry a request after an error
- feat: support callback for `retry` option
- Support for array in query parameters in the get method HOT 1
- setTimeout controlling the timeout is never cleared on response or error HOT 1
- Pick function HOT 1
- Typed API definition HOT 12
- Response does not contain headers HOT 2
- Receiving server-sent events (SSE) HOT 2
- Failed to upload Mega-sized base64 image HOT 1
- Go-like syntax to handle errors HOT 6
- error.statusText & error.statusMessage are undefined after Nuxt build but are set in dev
- deprecate `params` alias for `query` HOT 1
- the HTTP(S) Agent invalid HOT 7
- Can access to typed data in interceptors HOT 2
- Set cookies HOT 11
- error on Response.blob()
- Multipart image upload not working with fetch but with RapidAPI HOT 4
- Missing types in node export HOT 1
- `body` vs `params` option HOT 1
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 ofetch.