encapsulate source lookup and error handling
DRY out common "get sid, then source" pattern with g