Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout or Network Error is not detected if network is disconnected just after API request is done. #270

Open
akunal1 opened this issue Jul 29, 2021 · 0 comments

Comments

@akunal1
Copy link

akunal1 commented Jul 29, 2021

Hi,

If I am disconnecting the network just after api request and before receiving response then I am not getting any timeout error or network error . Any pointer would be really helpful.

export class RestService {
  api: ApisauceInstance;

  constructor() {
    this.api = apisauce.create({
      baseURL: '',
      headers: {
        'Content-type': 'application/json',
      },
      timeout: 30000, // Timeout set to 30sec
    });
  }

  getRequest = (apiUrl: string, params?: any, config?: ApisauceConfig) => {
    return this.api.get(apiUrl, params, config);
  };

"apisauce": "^2.0.1",
"react": "^17.0.1",
"react-native": "^0.62.2",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant