-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fire and forget option #57
Conversation
lgtm. |
My turn :) Anyway, by adding a That's why I was more ok with letting people skip the callback than with making them add a funky option if they want to use their code from node in the browser. Does this sound reasonable to you guys? [edit] |
I agree. Keep it as close to request as possible. Although I'm not a fan of these types of silent magic tricks, request has given us an interface to mirror. |
If we want to have the same interface as request we have no option but to not allow optional callbacks. I'm fine with callback always being required. silent exceptions are unacceptable. |
It depends on the type of exception and where it's coming from. I think for most network request failures, these exceptions already bubble up from the native implementation under the wrapper by virtue of XMLHTTP object opening and sending. Your browser console may also show these errors, usually without interrupting your running app client-side. |
Since we can't get a conclusion, and there's bugfixing and other work to do, I'm going to remove the change (make the callback obligatory again) and we can introduce something once we arrive at a decision. |
@naugtur well hang on a second, that error we nooped out the other day has nothing to do with whether a callback is optional, it's just a syntax error. it was confusing when i saw it at first too since i never wrote anything in my app calling |
@reqshark Thanks for pointing that out. I'll be careful not to reintroduce the problem (unless it was caused by not passing a callback, then I'll just make sure the error message is descriptive) |
@naugtur ya that'd be fine just wanted to keep that up on the bug killing radar you got going on here |
when the fire and forget option is true or at least not left undefined, then the constructor could be invoked without an error if you elect not to pass its callback function.