You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2026-05-22 09:05:38 +02:00
Improved network error handling
This commit is contained in:
@@ -8,8 +8,15 @@ function shimInit() {
|
||||
shim.fs = fs;
|
||||
shim.FileApiDriverLocal = FileApiDriverLocal;
|
||||
shim.Geolocation = GeolocationNode;
|
||||
shim.fetch = require('node-fetch');
|
||||
shim.FormData = require('form-data');
|
||||
|
||||
const nodeFetch = require('node-fetch');
|
||||
|
||||
shim.fetch = function(url, options = null) {
|
||||
if (!options) options = {};
|
||||
if (!options.timeout) options.timeout = 1000 * 120; // ms
|
||||
return nodeFetch(url, options);
|
||||
}
|
||||
|
||||
shim.fetchBlob = async function(url, options) {
|
||||
if (!options || !options.path) throw new Error('fetchBlob: target file path is missing');
|
||||
|
||||
Reference in New Issue
Block a user