title: How to prevent flutter app from crashing after Dio error?
body: <p>I am using the <code>flutter-dio</code> package to make HTTP requests and have made a wrapper on it from my convenience like so</p>
  
  <pre class="lang-dart prettyprint-override"><code>  Future&lt;dynamic&gt; post(String uri, dynamic body, {String authKeyCust}) async {
      authKey = await SecureStorage.getAuthKey();
      try {
        Response response = await dio.post(
          uri,
          data: body,
          options: Options(headers: {"authkey": authKeyCust ?? "$authKey"}),
        );
        return response.data;
      } on DioError catch (error) {
        print('error: $error');
      } on SocketException catch(error) {
        print('No net');
      }
    }
  </code></pre>
  
  <p>All I want is the app to not <em>crash/pause on exception</em> when any error occurs.</p>