Skip to content
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

CommAngular swalows the errors throwed by services called from commands #9

Closed
tstankevicius opened this issue Jan 16, 2015 · 3 comments

Comments

@tstankevicius
Copy link

Hello,

whenever error occurs on the service code called by command, the error is caught in commangular and simple message gets printed in console without providing stackstrace of where the error actually occurred.

Could you please fix it?

Thank you in advance.

@yukatan
Copy link
Owner

yukatan commented Jan 19, 2015

I have been thinking about add a debug mode to print this type of errors during development or maybe delegate errors to angular $exceptionHandler.

Could you print here the content of the error object managed by commangular?? commangular manage error as promises do, maybe if no handlers are found in commangular to manage an error commangular should launch an exception.

@tstankevicius
Copy link
Author

Hi,

e.g.: the Javascript console prints only the following message:

"Cannot read property 'subscribe' of undefined commangular.js:490"

and the requested error object which actually contains stack is as below. Maybe you could expose stack to the console as well?

Thank you.

error: TypeError
message: "Cannot read property 'subscribe' of undefined"
stack: "TypeError: Cannot read property 'subscribe' of undefined↵ at Object.execute (https://localhost:9000/resources/cdn/webcomponents/glp/scripts/common/command/saveEntityToProxyCommand.js:16:22)↵ at Object.e as invoke↵ at CommandContext.invoke (https://localhost:9000/resources/cdn/libs/bower_components/commangular/dist/commangular.js:370:21)↵ at https://localhost:9000/resources/cdn/libs/bower_components/commangular/dist/commangular.js:252:22↵ at https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:112:276↵ at l.$get.l.$eval (https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:126:84)↵ at l.$get.l.$digest (https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:123:195)↵ at l.$get.l.$apply (https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:126:362)↵ at l (https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:81:422)↵ at O (https://localhost:9000/resources/cdn/libs/bower_components/angular/angular.min.js:86:51)"
get stack: function () { [native code] }
set stack: function () { [native code] }
proto: Error
Call Stack
Scope Variables
Local
def: undefined
error: TypeError
this: undefined
Closure
Closure
Closure
Window
Global
Breakpoints
commangular.js:490
console.log(error && error.message);
orderAwardDirective.js:41
scope.selectBillingAccount = function(selectedBillingAccount, index) {
DOM Breakpoints
XHR Breakpoints
Event Listener Breakpoints
Workers
ConsoleSearchEmulationRendering

@yukatan
Copy link
Owner

yukatan commented Jan 21, 2015

Ok, to move the responsability for printing the error to the $exceptionHandler should be enough. I will add it as soon as I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants