nuxt / http

Universal HTTP Module for Nuxt.js
https://http.nuxtjs.org
MIT License
229 stars 51 forks source link

Type of onError hook's argument is not correct #175

Open harunorimurata opened 3 years ago

harunorimurata commented 3 years ago

ky.HTTPError doesn't have statusCode. https://github.com/nuxt/http/blob/86bf51e69a829efec5268593de998ecbc7d43c47/types/index.d.ts#L160

The correct type of this is ky.HTTPError & { statusCode?: number }. Please check the code and document below.

Source code: https://github.com/nuxt/http/blob/86bf51e69a829efec5268593de998ecbc7d43c47/lib/plugin.js#L100 Document: https://github.com/nuxt/http/blob/658b8822e5c24ecf5eb6207a25cf150b1f88bcc5/docs/content/en/5.advanced.md#L41