You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had a support request with AGOL and they need the response headers, there is no way to get them from this package without patching the module (which we are attempting) When a status code 500/503 (non 200) error is returned the response headers are not exposed via the error object.
Describe the proposed solution
We are seeing if this will work (in my simulations it appeared to). Tweaking this code here seemed to do it.
@efbenson thank you for logging this issue. This request seems reasonable to me. @patrickarlt@dbouwman do you have any thoughts on this request? Just to be clear, the proposed change is to change/add this code:
For this case the response object is not available since it is in the previous promise scope and not passed through to this promise that only receives the response body. Probably the simplest way to clean that up would be to refactor it to use await and try catches to keep the response object in scope. But it's a good bit of work for me to just patch into the module in production and we are not up for the risk.
Hi @efbenson, we think it might be easiest to create a variable up higher level in the scope (higher in the file) called something like originalResponseObject, and set that right before the switch/case block, so that then you can read from that variable within the .then(.. starting on line 476. Will that work for you?
Describe the problem
We had a support request with AGOL and they need the response headers, there is no way to get them from this package without patching the module (which we are attempting) When a status code 500/503 (non 200) error is returned the response headers are not exposed via the error object.
Describe the proposed solution
We are seeing if this will work (in my simulations it appeared to). Tweaking this code here seemed to do it.
https://github.com/Esri/arcgis-rest-js/blob/main/packages/arcgis-rest-request/src/request.ts#L424
Alternatives considered
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: