Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: http-envelope-normalizer: return request object (#13882)
Resolves #13791 This wrapper appears to try and detect error-like messages in responses from `wpcom.js` calls and turn them into proper JavaScript `Error`s. Previously however instead of returning the request object it created it was returning `undefined`. `wpcom.js` is supposed to return _either_ an XHR object _or_ a promise for the request. In this case, any code depending on the return value (XHR updloads, promise resolvers, etc...) would throw a `TypeError` because `undefined` has no properties. Now the code _returns_ the augmented request object instead of merely _calling_ it. cc: @retrofox
- Loading branch information