Giter Site home page Giter Site logo

Comments (3)

rogierschouten avatar rogierschouten commented on September 15, 2024 1

OK this is weird. Some data points on this issue:

var del = require("del");
var gulp = require("gulp");

gulp.task("clean", function() {
    return del([    "some_glob_leading_to_error"]);
});

No errors are printed, process stops. However, check this:

var del = require("del");
var gulp = require("gulp");
var util = require("util");

gulp.task("clean", function() {
    return del([    "some_glob_leading_to_error"]);
});

process.on("exit", function(exitcode) {
   console.log(util.inspect(gulp.tasks["clean"]));
});

This prints:

{ fn: [Function],
  dep: [ 'document_clean' ],
  name: 'clean',
  args:
   { task: 'clean',
     message: 'clean promise',
     duration: 5.95151387,
     hrDuration: [ 5, 951513870 ],
     err:
      { [Error: EBUSY: resource busy or locked, rmdir 'C:\some_dir']
        errno: -4082,
        code: 'EBUSY',
        syscall: 'rmdir',
        path: 'C:\\some_dir' } },
  running: false,
  duration: 5.95151387,
  hrDuration: [ 5, 951513870 ],
  done: true }

So, gulp apparently does get the error and doesn't print it. Time for some generic tests with promises:

var gulp = require("gulp");
var Promise = require("bluebird");

gulp.task("clean", function() {
    return Promise.reject(new Error("foo"));
});

Gulp nicely prints the error "foo".

This is with gulp 3.9.1.

So gulp can handle promises and del returns an error and somehow it doesn't work together.

from del.

SamVerschueren avatar SamVerschueren commented on September 15, 2024

And does it do something with a catch function? It should be the same though, but you never know.

from del.

sholladay avatar sholladay commented on September 15, 2024

What happens if you use Gulp 4? npm install gulpjs/gulp#4.0

How it orchestrates tasks under the hood is completely different. And it's very stable, I have been using it a lot for the past 6 months without any hiccups.

from del.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.