breeze - Query failed and the error.message is the data -
a friend's query failing. fortunately, catching in fail callback (you have fail callback every server call, right?). here's kind of had:
var getpersons = function(personsobservable) { homecoming entityquery.from('person') .using(manager).execute() .then(querysucceeded).fail(queryfailed); } function queryfailed(error) { var msg = 'error retreiving data. ' + error.message; logerror(msg, error); throw error; }the error.message
showed json info ... looked bit this:
wat? examined error.xhr
provides total ajax xhr object used query. see http status code 200 ... meaning cool server. fact had real info pretty much said same thing.
so why breeze failing? how diagnose problem?
breeze might failing. there's chance problem lies elsewhere. if breeze fails, there meaningful error message. error message not meaningful. provide clues.
check success callback firstthe fail callback can invoked (1) if operation fails or (2) if success callback fails. if operation fails, you've got breeze-related problem. if success callback fails, have application code problem.
to determine which, set breakpoint on first line of success callback (in case, first line of querysucceeded
). if nail breakpoint, know breeze has done bit , has handed off you. step through callback find mistakes yours and, therefore, easy fix.
in case did not success callback. went wrong breeze tried create cached entities out of json info server. be?
there many potential causes. breeze bug. best, though, eliminate airplane pilot error first. did write custom constructor or initializer entitytype
?
he did. had initializer added fullname
calculated property person
. looked sort of this:
he didn't see problem. next diagnostic procedure, put breakpoint on initializer.
sure plenty ... had typo ...
// "entity" not exist. null object error homecoming entity.firstname() + ' ' + person.lastname();as changed entity
person
, well.
i can't explain @ moment why null object reference manifested q promise fail
error json person
info in message. unusual stuff happens in javascript. clues there:
person
have person
initializer (or constructor) read clues , you'll know look.
hope tip saves grayness hair , bald head.
breeze
No comments:
Post a Comment