Javascript check if error contains string.