vladimiry / fs-no-eperm-anymore Goto Github PK
View Code? Open in Web Editor NEWReducing EPERM or other errors on win32 or other platforms using retry loop approach
License: MIT License
Reducing EPERM or other errors on win32 or other platforms using retry loop approach
License: MIT License
Like specifying custom parameters for the specific functions and error codes, following the inheritance ideas. So options might look like this:
const options = {
platform: "win32", // optional
retryIntervalMs: 50,
retryTimeoutMs: 30 * 1000,
retryCountLimit: 123, // optional
errorCodes: ["EPERM"],
errorCodesMap: { // optional
EACCS: {
retryIntervalMs: 500, // optional
retryTimeoutMs: 10 * 1000, // optional
retryCountLimit: 345, // optional
},
},
functionsMap: { // optional
rename: {
platform: "linux", // optional
retryIntervalMs: 50, // optional
retryTimeoutMs: 30 * 1000, // optional
retryCountLimit: 45746, // optional
errorCodesMap: { // optional
EPERM: {
retryIntervalMs: 5454, // optional
retryTimeoutMs: 123 * 1000, // optional
retryCountLimit: 662, // optional
},
EEXIST: {
retryIntervalMs: 1500, // optional
retryTimeoutMs: 5 * 1000, // optional
retryCountLimit: 345, // optional
},
},
},
},
};
Where:
platform
and retryCountLimit
are always optional. If the are no values specified, then retry executes for any platform and number of retry attempts is not limited by the retryCountLimit
value (only by the retryIntervalMs
and retryTimeoutMs
).retryIntervalMs
and retryTimeoutMs
are optional on any level except the top level. Means if there is no custom values defined on the errorCodesMap
/ functionsMap
levels/sub-levels, then default values defined on the top level take place.errorCodes
basically can be an empty array, then no error handling happens - any happened error re-throws (goes up).platform
can be specified on either top or Options.functionsMap[<function name
>] levels.So retryIntervalMs
, retryTimeoutMs
, retryTimeoutMs
resolving occurs in the inherited way (from the most narrow object, up to the wider/global object):
function name
>].errorCodes[<error code
>]function name
>]error code
>]A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.