Generalize error catching
Merge branch 'client'