#15579 closed defect (fixed)
instrumenting does not log strings
Reported by: | Adam Peller | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8 |
Component: | Dijit | Version: | 1.8.0b1 |
Keywords: | Cc: | Mark Wubben | |
Blocked By: | Blocking: |
Description
dijit/Tree _setPathsAttr does stuff like
def.reject("Could not expand path at " + nextPath);
passing a string to reject. instrumenting.js only seems to know how to log error objects, looking for error.stack. If passed just a string, an empty console.error is issued. Is this a proper use of the Deferred API? If so, perhaps this is a Deferred issue and instrumenting.js should handle strings?
Change History (5)
comment:1 Changed 10 years ago by
Cc: | Mark Wubben added |
---|
comment:2 Changed 10 years ago by
Version: | 1.7.3 → 1.8.0b1 |
---|
comment:3 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|---|
Status: | new → assigned |
OK, I'll fix, thanks for catching the problem.
Note: See
TracTickets for help on using
tickets.
It could certainly cast the error object to a string. This is what I tend to do normally:
Because instrumenting also tries to log a stack trace we can't quite do that, so I'll just cast it to a string.
Generally though I think promises should only be rejected with non-error values if the rejection is used as a way to short-circuit a part of the promise chain. You could throw a result object so 5 other normal callbacks don't get called. In this particular case we're dealing with an actual error, so it should be an error instance not a string.