Js error is not a function. Try js. условие try catch. catch error js. throw new error js.