"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _reactNative = require("react-native");

//Imports
const status = {
  checkStatus(response) {
    try {
      console.log("Response: ", JSON.stringify(response));
    } catch (err) {
      console.log(err);
    }

    if (response.status > 500) throw new Error('Server error. Try again after some time.  ' + response.status);

    if (response.ok) {
      //status 200
      return response;
    } else {
      //Service Failed Message 
      let error = new Error("Service returned invalid response: " + response.statusText + response.status);
      error.response = response;
      throw error;
    }
  }

};
var _default = status;
exports.default = _default;
//# sourceMappingURL=Status.js.map