{"action":"created","issue":{"url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/104","labels_url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/104/comments","events_url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/104/events","html_url":"https://github.com/martinisgroup/pylabrad/issues/104","id":76852551,"number":104,"title":"Server/client exception handling","user":{"login":"chrismacklin","id":11823706,"avatar_url":"https://avatars.githubusercontent.com/u/11823706?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismacklin","html_url":"https://github.com/chrismacklin","followers_url":"https://api.github.com/users/chrismacklin/followers","following_url":"https://api.github.com/users/chrismacklin/following{/other_user}","gists_url":"https://api.github.com/users/chrismacklin/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismacklin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismacklin/subscriptions","organizations_url":"https://api.github.com/users/chrismacklin/orgs","repos_url":"https://api.github.com/users/chrismacklin/repos","events_url":"https://api.github.com/users/chrismacklin/events{/privacy}","received_events_url":"https://api.github.com/users/chrismacklin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-15T20:43:17Z","updated_at":"2015-05-16T00:52:51Z","closed_at":null,"body":"If a server raises an unhandled exception during execution of a command, a labrad.types.Error is raised in the client with the stack trace as a string in Error.msg .  I notice this note in labrad.types.Error:\r\n```\r\n# TODO register error classes by code, so remote errors can be reraised\r\n```\r\nI've also noticed that servers tend to raise garden-variety Exception, rather than a more descriptive error.  Would best practice be to go ahead and define more descriptive Exceptions?  It looks like some error codes are already defined in labrad.errors, but using unique numeric codes for \"end-user\" errors isn't feasible for forward cross-compatibility.\r\n\r\nThoughts/comments/guidance?"},"comment":{"url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/comments/102555183","html_url":"https://github.com/martinisgroup/pylabrad/issues/104#issuecomment-102555183","issue_url":"https://api.github.com/repos/martinisgroup/pylabrad/issues/104","id":102555183,"user":{"login":"pomalley","id":1106276,"avatar_url":"https://avatars.githubusercontent.com/u/1106276?v=3","gravatar_id":"","url":"https://api.github.com/users/pomalley","html_url":"https://github.com/pomalley","followers_url":"https://api.github.com/users/pomalley/followers","following_url":"https://api.github.com/users/pomalley/following{/other_user}","gists_url":"https://api.github.com/users/pomalley/gists{/gist_id}","starred_url":"https://api.github.com/users/pomalley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pomalley/subscriptions","organizations_url":"https://api.github.com/users/pomalley/orgs","repos_url":"https://api.github.com/users/pomalley/repos","events_url":"https://api.github.com/users/pomalley/events{/privacy}","received_events_url":"https://api.github.com/users/pomalley/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T00:52:51Z","updated_at":"2015-05-16T00:52:51Z","body":"What I've done, for now, is to define exception subclasses as necessary in the servers, and when they get raised, catch labrad.types.Error on the client side and check for `[exception class name] in err.msg`, and handle from there. (And then if I don't find the particular exception type re-raise the error.)"}}