From 1515ecaa225fbde693001a05d6ccbaac837f3803 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Wed, 17 Jul 2019 13:47:18 +0300 Subject: [PATCH] fix(bowser): remove custom error due to the bug (#335) --- src/bowser.js | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/bowser.js b/src/bowser.js index 67136ed..f79e6e0 100644 --- a/src/bowser.js +++ b/src/bowser.js @@ -12,17 +12,6 @@ import { PLATFORMS_MAP, } from './constants.js'; -/** - * @class - * @property name - */ -class BowserUAIsNotAStringError extends Error { - constructor(message) { - super(message); - this.name = 'BowserUAIsNotAStringError'; - } -} - /** * Bowser class. * Keep it simple as much as it can be. @@ -42,7 +31,7 @@ class Bowser { * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it * explicitly. Same as `skipParsing` for {@link Parser}. * @returns {Parser} - * @throws {BowserUAIsNotAStringError} when UA is not a String + * @throws {Error} when UA is not a String * * @example * const parser = Bowser.getParser(window.navigator.userAgent); @@ -50,7 +39,7 @@ class Bowser { */ static getParser(UA, skipParsing = false) { if (typeof UA !== 'string') { - throw new BowserUAIsNotAStringError('UserAgent should be a string'); + throw new Error('UserAgent should be a string'); } return new Parser(UA, skipParsing); }