Throwing literals as exceptions is not recommended JS-0091
Anti-pattern
Minor
5 months ago3 years old
Expected an error object to be thrown
 8400  }),
 8401  (e.Vector.prototype.insert = function (e, t) {
 8402    this.upsert(e, t, function () {
 8403      throw 'duplicate index' 8404    })
 8405  }),
 8406  (e.Vector.prototype.upsert = function (e, t, r) {
Expected an error object to be thrown
 8177  (e.FieldRef.joiner = '/'),
 8178  (e.FieldRef.fromString = function (t) {
 8179    const r = t.indexOf(e.FieldRef.joiner)
 8180    if (r === -1) throw 'malformed field ref string' 8181    const i = t.slice(0, r)
 8182    const n = t.slice(r + 1)
 8183    return new e.FieldRef(n, i, t)
358      return
359    }
360
361    throw `unsupported type ${field_name}: (${typeof value}) ${value}`362  }
363}
315      _my.no_overflow53(value.toInt(), field_name)
316      return
317    }
318    throw `unsupported type ${field_name}: (${typeof value}) ${value}`319  },
320
321  // signed / unsigned whole numbers only
132    if (Long.isLong(value)) {
133      return value.toString()
134    }
135    throw `unsupported type ${field_name}: (${typeof value}) ${value}`136  },
137
138  require_test (regex, value, field_name = '') {