diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/Dawn/static/utils.js | 8 | ||||
| -rw-r--r-- | python/Dawn/views.py | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/python/Dawn/static/utils.js b/python/Dawn/static/utils.js index 0b886e8f..f74d681f 100644 --- a/python/Dawn/static/utils.js +++ b/python/Dawn/static/utils.js @@ -14,8 +14,12 @@ function query(url, params, callback){ var xhr = new XMLHttpRequest(); xhr.open('GET', url + '?' + encode_dict(params)); xhr.onreadystatechange = function() { - if( xhr.readyState === 4){ - callback(xhr.responseText); + if( xhr.readyState === 4 ) { + if( xhr.status === 200 ) { + callback(xhr.responseText) + } else if ( xhr.status === 400 ) { + console.log(xhr.responseText) + } } } xhr.send(); diff --git a/python/Dawn/views.py b/python/Dawn/views.py index 33365aa2..5f267f1b 100644 --- a/python/Dawn/views.py +++ b/python/Dawn/views.py @@ -207,7 +207,7 @@ def get_bbg_id(): try: _, indextype, _, series, tenor = bbg_id.split() except ValueError: - return None + return "not a valid bloomberg description", 400 indextype = indextype[:2] tenor = tenor[:-1] + 'yr' series = int(series[1:]) |
