javascript - How to read from the console log and if the error includes the string " up-to-data" to pass the 'if' cycle with no error -
p4.run("sync", filename, function (syncerror, updateddate) { var logdata = console.log(syncerror); if() { } });
i'm not sure how implement this.. if there error include string "up-to-date" "if" cycle needs pass no errors.
p4.run("sync", filename, function (syncerror, updateddate) { var logdata = syncerror.tostring(); if(logdata.indexof('up-to-date')!==-1){ return true; } else { console.log('not found'); throw new error(syncerror.message); } });
i figure out way. works me. hint void!
Comments
Post a Comment