Add basic error handling

This way if there is an issue with the outgoing request it won't kill your process.