speckleworks / SpeckleCore

Check a brand new Speckle at: https://github.com/specklesystems
https://speckle.systems
MIT License
38 stars 17 forks source link

Handle API failures when not connected to the internet #84

Open teocomi opened 6 years ago

teocomi commented 6 years ago

Should probably throw an exception when no internet is available or the API cannot be reached. If the call below fails there is not catch to handle it: https://github.com/speckleworks/SpeckleCore/blob/a8c054ab499578bd3f014a5298c5e99db460f382/SpeckleCore/SpeckleApiClientApiCalls.cs#L337

didimitrie commented 6 years ago

I would see the easiest way to fix this via an InternetAccess flag which can be checked in the PrepareRequest and execeptions thrown. https://github.com/speckleworks/SpeckleCore/blob/master/SpeckleCore/SpeckleApiClientHead.cs#L58

I'm hesitant to change the autogenerated code, as it will make subsequent future generations more painful. But if nswag can be coerced into adding that catch, i'm fine :)