Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

feedback on error #117

Closed
jpcaruana opened this Issue · 3 comments

3 participants

@jpcaruana

Hi,
when curl fails to load files (eg. circular dependency), there is no feedback to help, not even an error.
It would be great to have some kind of feedback : a console log, an error or even a (horrible) alert window.

@unscriptable
Owner

Hey @jpcaruana!

Are you using AMD-wrapped commonjs modules? Just wondering because they allow curl.js to detect and circumvent circular dependencies. It's problematic (and cpu-intensive) to detect cycles in "normal" AMD modules.

Fwiw, I never advocate coding cycles on purpose. There's never a good use case for them. :)

On the other hand, there's always the possibility of a circular dependency happening by accident. curl.js doesn't offer any feedback when this happens. I guess this is what you encountered?

I guess I should add some documentation that explains that silence means a circular dependency. (Some plugins can cause silent failures, too, actually.) 404s, mismatched module ids, and syntax errors are noisy -- as you'd expect.

Thanks for alerting me to this. I'll fix the docs.

Regards,

-- John

@unscriptable unscriptable was assigned
@jpcaruana

Ok. Thanks for your answer. I'll try to avoid circular dependency next time :)
Regards,
-- JP

@stevenvachon

I'm getting no feedback on a 404.

I combined curl with the plugins: css, j, text

curl(
    [
        "js!scripts/library.js",
        "css!stylesheets/style.css",
        "text!templates/template.html",
        "js!scripts/library123.js"  // renamed to cause a 404
    ]
).then(
    function(){ console.log(arguments); },
    function(){ console.log("ERROR"); } // never called
);

Here is the browser (Safari) error in the console:
Failed to load resource file://localhost/Users/user/Desktop/Test/scripts/library123.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.