diff options
| author | LV-426 <lv-426@taproot.org.il> | 2015-03-30 20:43:03 +0300 |
|---|---|---|
| committer | LV-426 <lv-426@taproot.org.il> | 2015-04-01 22:25:54 +0300 |
| commit | 1845494ef269013b81b9f0e8ef44e4ec4849e1cd (patch) | |
| tree | bbd2adb696eeeee95e6f195e5e1c01c0a0cd1e14 /src | |
| parent | 15cb9bfee13aa682656cfb566f4d542f7608ae72 (diff) | |
rz_api_backend: expect ajax errors to be server with non 200 HTTP status
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/rz_api_backend.js | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/client/rz_api_backend.js b/src/client/rz_api_backend.js index 76f65fe7..79b8ab89 100644 --- a/src/client/rz_api_backend.js +++ b/src/client/rz_api_backend.js @@ -39,19 +39,14 @@ define(['model/core'], function(model_core) { function on_success_wrapper(xhr, text) { // log wrap callback - var ret_data = xhr.data, - ret_error = xhr.error; - if (ret_error) { - console.log('ajax error: ' + JSON.stringify(ret_error)); - if (on_error) { - on_error(ret_error); - } - } else { - console.log('ajax success: ' + shorten(JSON.stringify(ret_data), 50)); - if (on_success) { - on_success(ret_data); - } - } + var ret_data = xhr.data; + util.assert(undefined == xhr.error); // assert we no longer return errors along with HTTP 200 status codes + + console.log('ajax success: return value:'); + console.dir(ret_data); + if (on_success) { + on_success(ret_data); + }; } /* |
