throwing Warning: a promise was rejected with a non-error: [object Object]

117 views Asked by At
  function fetch(options) {
   return new Promise((resolve, reject) => {
     this.request(options, (err, response, status, xhr) => {
     console.log('err res', err, response);//#console2
     return err ? reject(err) : resolve(response);
     });
   });
  }

This is my block of code. I have already seen a lot of related questions but still couldn't find anything. In my case, I'm calling this fetch method from 2 places within a project with the same input and I'm getting the same error for both the time i.e till #console2 everything is the same but while returning one time it is throwing warning promise was rejected with a non-error: and for another call, it is not throwing anything. Please let me know if anyone is aware of this issue. Thanks in advance :) .

0

There are 0 answers