typescript try catch throw new error