diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-15 12:58:23 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-15 12:58:23 +0200 |
| commit | 8af3f37f5a6dec31877b0c67c996cb52f513d020 (patch) | |
| tree | 7fecd3a7fd072d02c59aafefd3eba7c2f8a712e3 /src/client | |
| parent | 4e5ca4fb71b04ed7584669878ad9c3644ac5d4ae (diff) | |
client: add util.log_error, use for clone missing dst/src ids
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/model/graph.js | 4 | ||||
| -rw-r--r-- | src/client/util.js | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/client/model/graph.js b/src/client/model/graph.js index 9662378c..f8783127 100644 --- a/src/client/model/graph.js +++ b/src/client/model/graph.js @@ -796,11 +796,11 @@ function Graph(spec) { link_spec.__dst = find_node__by_id(dst_id); if (null === link_spec.__src) { - console.log("src_id not found: " + src_id); + util.log_error("src_id not found: " + src_id); return null; } if (null === link_spec.__dst) { - console.log("dst_id not found: " + dst_id); + util.log_error("dst_id not found: " + dst_id); return null; } diff --git a/src/client/util.js b/src/client/util.js index d2114e4c..20dff15a 100644 --- a/src/client/util.js +++ b/src/client/util.js @@ -228,6 +228,11 @@ define(['jquery'], function($) { return ret; } + // logging helpers + function log_error(msg) { + console.log('error: ' + msg); + } + return { array_diff: array_diff, assert: assert, @@ -242,5 +247,7 @@ define(['jquery'], function($) { set_diff: set_diff, setSelection: setSelection, selectionStart: selectionStart, + + log_error: log_error, }; }); |
