When function is called without args, converter throws TypeError.
This commit unifies it.
code_format has been also applied.
[Verification] Builts successful, tested in chrome console
Change-Id: I032fd3f78e06b561ae472cdbbafe3bcf4092a6d9
Signed-off-by: Rafal Walczyna <r.walczyna@samsung.com>
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.name) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: name is undefined'
);
}
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.index) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: index is undefined'
);
}
if (!args.has.definition) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: pipeline definition is mandatory'
);
}
if (!args.has.name) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: name is mandatory'
);
}
if (!args.has.name) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: sink name is mandatory'
);
}
if (!args.has.padName) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: pad name is mandatory'
);
}
if (!args.has.open) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: open is mandatory'
);
}
if (!args.has.name) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: custom filter name is mandatory'
);
}
if (!args.has.name) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: name is undefined'
);
}
if (!args.has.name || !args.has.value) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: ' + (args.has.name ? 'value' : 'name') + ' is undefined'
);
}
}
};
-var SetTimeoutValidExceptions = [
- 'NotSupportedError',
- 'AbortError'
-];
+var SetTimeoutValidExceptions = ['NotSupportedError', 'AbortError'];
SingleShot.prototype.setTimeout = function() {
checkSingleShotNotClosed(this);
var args = validator_.validateArgs(arguments, [
if (!args.has.timeout) {
throw new WebAPIException(
- WebAPIException.INVALID_VALUES_ERR,
+ WebAPIException.TYPE_MISMATCH_ERR,
'Invalid parameter: timeout is undefined'
);
}
}
};
-var CloseValidExceptions = [
- 'AbortError'
-];
+var CloseValidExceptions = ['AbortError'];
SingleShot.prototype.close = function() {
checkSingleShotNotClosed(this);
var callArgs = {
var result = native_.callSync('MLSingleShotClose', callArgs);
if (native_.isFailure(result)) {
- throw native_.getErrorObjectAndValidate(
- result,
- CloseValidExceptions,
- AbortError
- );
+ throw native_.getErrorObjectAndValidate(result, CloseValidExceptions, AbortError);
}
this._id = undefined;
};
::testing::InitGoogleTest(&argc, argv);
if (argc > 1) {
if (strcmp("gbs", argv[1]) == 0) {
- printf("WARNING: ML unit tests are not suitable to run inside GBS. "
- "Please run these tests on real device.\n");
+ printf(
+ "WARNING: ML unit tests are not suitable to run inside GBS. "
+ "Please run these tests on real device.\n");
return 0;
}
}