Parcourir la source

Decaf cleanup: do not throw strings

Eric Mc Sween il y a 5 ans
Parent
commit
db4b0a6f38
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      services/document-updater/app/js/DiffCodec.js

+ 1 - 2
services/document-updater/app/js/DiffCodec.js

@@ -2,7 +2,6 @@
     camelcase,
     handle-callback-err,
     new-cap,
-    no-throw-literal,
 */
 const { diff_match_patch } = require('../lib/diff_match_patch')
 const dmp = new diff_match_patch()
@@ -35,7 +34,7 @@ module.exports = {
       } else if (type === this.UNCHANGED) {
         position += content.length
       } else {
-        throw 'Unknown type'
+        throw new Error('Unknown type')
       }
     }
     callback(null, ops)