Update assert_throws to support more errors defined in WebIDL.