Merge pull request #2 from gmaclennan/xhr-error-catching

Add xhr error catching