Add exception handling for network errors

Useful when working offline or having network problems