ref(utils): use web reportError helper (#3283)

This commit is contained in:
virtuacoplenny
2018-07-21 08:16:32 -07:00
committed by GitHub
parent 9f015df61d
commit 918fb1dfc6
4 changed files with 20 additions and 25 deletions

View File

@@ -1,5 +1,7 @@
/* @flow */
import { reportError } from '../util';
/**
* Parses the query/search or fragment/hash parameters out of a specific URL and
* returns them as a JS object.
@@ -36,10 +38,8 @@ export default function parseURLParams(
= JSON.parse(decodeURIComponent(value).replace(/\\&/, '&'));
}
} catch (e) {
const msg = `Failed to parse URL parameter value: ${String(value)}`;
console.warn(msg, e);
window.onerror && window.onerror(msg, null, null, null, e);
reportError(
e, `Failed to parse URL parameter value: ${String(value)}`);
return;
}