diff --git a/frameworks/js/ani/vibrator/ets/@ohos.vibrator.ets b/frameworks/js/ani/vibrator/ets/@ohos.vibrator.ets index 3104e87f882bbb8f46bda187937c1b24dbb6e305..710ed2a0b7471c9e920faf94844f79e67f06565f 100644 --- a/frameworks/js/ani/vibrator/ets/@ohos.vibrator.ets +++ b/frameworks/js/ani/vibrator/ets/@ohos.vibrator.ets @@ -29,8 +29,8 @@ export default namespace vibrator { let p1 = taskpool.execute(startVibrationIntSync, effect, attribute); p1.then((e: NullishType)=>{ console.log("in callback startVibration then.") - let err1 : BusinessError - callback(err1, undefined); + let err = new BusinessError; + callback(err, undefined); }); p1.catch((err: NullishType) => { console.log("startVibration catch in callback thread."); @@ -61,7 +61,7 @@ export default namespace vibrator { p1.then((e: NullishType)=>{ let r = e as boolean; console.log("in callback isSupportEffectInterally then. e is ", e) - let err : BusinessError + let err = new BusinessError; callback(err, r); }); p1.catch((error: NullishType) => {