react-native-gigya-sdk
Version:
SAP CDC/Gigya SDK for your React Native applications
23 lines (20 loc) • 529 B
JavaScript
import formatError from './formatError';
export default function (sdkCall, options) {
return new Promise(async (resolve, reject) => {
try {
let response = null;
try {
response = await sdkCall;
} catch (e) {
return reject(formatError(e));
}
if (!(options !== null && options !== void 0 && options.noParsing)) {
response = JSON.parse(response);
}
resolve(response);
} catch (e) {
reject(e);
}
});
}
//# sourceMappingURL=handleSdkCall.js.map