[links] revert the try/catch

This commit is contained in:
Omer Levy 2018-01-13 00:32:30 +02:00
parent 8d7152fe70
commit ae98c67a37
1 changed files with 14 additions and 6 deletions

View File

@ -108,9 +108,13 @@ export default class Links extends ModuleBase {
* @returns {Promise.<String>}
*/
createDynamicLink(parameters: Object = {}): Promise<string> {
checkForMandatoryParameters(parameters);
validateParameters(parameters);
return getNativeModule(this).createDynamicLink(parameters);
try {
checkForMandatoryParameters(parameters);
validateParameters(parameters);
return getNativeModule(this).createDynamicLink(parameters);
} catch (error) {
return Promise.reject(error);
}
}
/**
@ -119,9 +123,13 @@ export default class Links extends ModuleBase {
* @returns {Promise.<String>}
*/
createShortDynamicLink(parameters: Object = {}): Promise<String> {
checkForMandatoryParameters(parameters);
validateParameters(parameters);
return getNativeModule(this).createShortDynamicLink(parameters);
try {
checkForMandatoryParameters(parameters);
validateParameters(parameters);
return getNativeModule(this).createShortDynamicLink(parameters);
} catch (error) {
return Promise.reject(error);
}
}
}