Adding fixes to simpler find bugs
This commit is contained in:
parent
596bdcd7c8
commit
582bcfb3a3
@ -17,15 +17,28 @@ const _runningInNode = (
|
||||
* Function to call a function something direct async
|
||||
*/
|
||||
export const callImmediate = _runningInNode ? (callback: (...args) => void, ...args) => {
|
||||
// return setTimeout(callback, 0, ...args);
|
||||
const trace = new Error("Error for Bugtracing");
|
||||
return setImmediate(() => {
|
||||
try {
|
||||
callback(...args);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.log("Trancing Bug with the Following Error");
|
||||
console.error(trace);
|
||||
}
|
||||
});
|
||||
} : (callback: (...args) => void, ...args) => {
|
||||
return setTimeout(callback, 0, ...args);
|
||||
const trace = new Error("Error for Bugtracing");
|
||||
return setTimeout(() => {
|
||||
try {
|
||||
callback(...args);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.log("Trancing Bug with the Following Error");
|
||||
console.error(trace);
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
|
||||
export const callDirect = (callback: (...args) => void, ...args) => {
|
||||
|
Loading…
Reference in New Issue
Block a user