[core][js] catch error in Map