{"action":"created","issue":{"url":"https://api.github.com/repos/vufind-org/vufind/issues/587","repository_url":"https://api.github.com/repos/vufind-org/vufind","labels_url":"https://api.github.com/repos/vufind-org/vufind/issues/587/labels{/name}","comments_url":"https://api.github.com/repos/vufind-org/vufind/issues/587/comments","events_url":"https://api.github.com/repos/vufind-org/vufind/issues/587/events","html_url":"https://github.com/vufind-org/vufind/pull/587","id":131728264,"number":587,"title":"AJAX error codes","user":{"login":"crhallberg","id":451107,"avatar_url":"https://avatars.githubusercontent.com/u/451107?v=3","gravatar_id":"","url":"https://api.github.com/users/crhallberg","html_url":"https://github.com/crhallberg","followers_url":"https://api.github.com/users/crhallberg/followers","following_url":"https://api.github.com/users/crhallberg/following{/other_user}","gists_url":"https://api.github.com/users/crhallberg/gists{/gist_id}","starred_url":"https://api.github.com/users/crhallberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crhallberg/subscriptions","organizations_url":"https://api.github.com/users/crhallberg/orgs","repos_url":"https://api.github.com/users/crhallberg/repos","events_url":"https://api.github.com/users/crhallberg/events{/privacy}","received_events_url":"https://api.github.com/users/crhallberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-05T19:09:12Z","updated_at":"2016-02-12T15:59:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/vufind-org/vufind/pulls/587","html_url":"https://github.com/vufind-org/vufind/pull/587","diff_url":"https://github.com/vufind-org/vufind/pull/587.diff","patch_url":"https://github.com/vufind-org/vufind/pull/587.patch"},"body":"I made sure every error return in the AjaxController is throwing an appropriate error code. This makes it easier to use jQuery.ajax with success and error.\r\n\r\nWanted to PR to make sure I used the best practices and codes.\r\n\r\nCodes used\r\n- 400 - Bad Request\r\n- 401 - Unauthorized\r\n- 405 - Method not allowed\r\n- 500 - Server Error (generic)"},"comment":{"url":"https://api.github.com/repos/vufind-org/vufind/issues/comments/183385740","html_url":"https://github.com/vufind-org/vufind/pull/587#issuecomment-183385740","issue_url":"https://api.github.com/repos/vufind-org/vufind/issues/587","id":183385740,"user":{"login":"demiankatz","id":309069,"avatar_url":"https://avatars.githubusercontent.com/u/309069?v=3","gravatar_id":"","url":"https://api.github.com/users/demiankatz","html_url":"https://github.com/demiankatz","followers_url":"https://api.github.com/users/demiankatz/followers","following_url":"https://api.github.com/users/demiankatz/following{/other_user}","gists_url":"https://api.github.com/users/demiankatz/gists{/gist_id}","starred_url":"https://api.github.com/users/demiankatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/demiankatz/subscriptions","organizations_url":"https://api.github.com/users/demiankatz/orgs","repos_url":"https://api.github.com/users/demiankatz/repos","events_url":"https://api.github.com/users/demiankatz/events{/privacy}","received_events_url":"https://api.github.com/users/demiankatz/received_events","type":"User","site_admin":false},"created_at":"2016-02-12T15:59:43Z","updated_at":"2016-02-12T15:59:43Z","body":"This is looking pretty good. A couple of questions:\r\n\r\n1.) In common.js, in ajaxLogin(), there are two nested AJAX calls. You've eliminated both `response.status == 'OK'` checks, but you've only added in one error handler (on the innermost of the two calls). Is this intentional, or do you also need to add another error handler to the outermost call?\r\n\r\n2.) This thread seems to suggest that the success/error callbacks are deprecated in favor of done/fail -- http://stackoverflow.com/questions/13168572/call-to-jquery-ajax-fail-vs-error -- does this affect us, or is somebody misinterpreting something?\r\n\r\n3.) You've added this code to lightbox.js:\r\n\r\n    if ('undefined' == typeof obj.error) {\r\n      obj.error = function() {\r\n        Lightbox.displayError(response.data);\r\n      };\r\n    }\r\n\r\nWhat is its purpose? In particular, I don't understand where \"response\" is coming from in this context -- it's not a defined global and it's not passed in anywhere.\r\n\r\nAside from those things, this is looking great, and I think we should be able to merge it soon. However, I'd like to wait and hear your thoughts on these points before I devote any time to testing, because if we find ourselves having to change all of our AJAX calls to avoid deprecation, it's better to do that BEFORE tackling a comprehensive test."}}