sampie777 / hymnbook2

Mobile hymn book app.
https://hymnbook.sajansen.nl/
Other
2 stars 0 forks source link

TypeError: Network request failed #167

Closed sampie777 closed 1 year ago

sampie777 commented 1 year ago

View details in Rollbar: https://rollbar.com/sa.jansen1/hymnbook/items/180/


TypeError: Network request failed
  File "http://reactnativehost/[native code]", line unknown, in value
  File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 112, in value
        this.__guard(() => {
  File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 367, in value
            fn();
  File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 113, in [anonymous]
          this.__callFunction(module, method, args);
  File "node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js", line 423, in value
        moduleMethods[method].apply(moduleMethods, args);
  File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 357, in callTimers
          _callTimer(timersToCall[i], 0);
  File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 112, in k
          callback();
  File "node_modules/react-native/Libraries/Core/Timers/JSTimers.js", line 214, in [anonymous]
          () => func.apply(undefined, args),
  File "node_modules/whatwg-fetch/dist/fetch.umd.js", line 535, in fetch
              reject(new TypeError('Network request failed'));
sampie777 commented 1 year ago

Don't know where in the code this error was thrown. All fetch() have an explicit error message ("API request to ...") except for the features request: .catch(null); in the FeaturesProvider:25. Maybe this error comes from here?

Let's wait for more of these errors.

sampie777 commented 1 year ago

Jep, apparently this doesn't silence the error:

fetch("")
  .catch(null)
  .catch(() => console.log("this will show"))

And this does:

fetch("")
  .catch(() => null)
  .catch(() => console.log("this won't show"))