mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Infra] Reset error state in useHTTPRequest hook (#166752)
Closes #166748 ## Summary This PR fixes an issue with the error state - when there is a successful request after a failed request the error state was still visible. ### Before0cb15cab
-dc7c-48ad-b080-179f0444284d ### Aftere765b5e9
-d213-45da-968f-257955b1f4b0
This commit is contained in:
parent
0ba75eec8a
commit
0d18be6356
1 changed files with 1 additions and 0 deletions
|
@ -106,6 +106,7 @@ export function useHTTPRequest<Response>(
|
|||
onResolve: (resp) => {
|
||||
try {
|
||||
setResponse(decode(resp)); // Catch decoding errors
|
||||
setError(null);
|
||||
} catch (e) {
|
||||
onError(e);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue