aboutsummaryrefslogtreecommitdiff
path: root/examples/browser
diff options
context:
space:
mode:
authorMarak <[email protected]>2021-03-25 17:32:27 -0400
committerMarak <[email protected]>2021-03-25 17:32:27 -0400
commitfac3164beb08d2eb175bb980e9821e36be8464af (patch)
tree86df68df0ac20a00c94160bf47fdd699d64a9b8e /examples/browser
parent149289afa955d81bed410104d5f034eb1495fe9d (diff)
downloadfaker-fac3164beb08d2eb175bb980e9821e36be8464af.tar.xz
faker-fac3164beb08d2eb175bb980e9821e36be8464af.zip
Add try/catch around example page calls
Was causing issue with Mersenne methods
Diffstat (limited to 'examples/browser')
-rw-r--r--examples/browser/index.html13
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/browser/index.html b/examples/browser/index.html
index 844e15d8..575b7abd 100644
--- a/examples/browser/index.html
+++ b/examples/browser/index.html
@@ -48,7 +48,11 @@
<td align="right"><input class="fakerButton" type="button" value="' + module + "." + method +'" id="' + inputID + '"/></td>';
// get the default value
- var val = faker[module][method]();
+ var val = '';
+ try {
+ val = faker[module][method]();
+ } catch (err) {
+ }
// switch input type based on default string / object value being returned
if (typeof val === "object") {
@@ -72,7 +76,12 @@
var arr = inputID.split('_');
var module = arr[1];
var method = arr[2];
- var val = faker[module][method]();
+ var val = '';
+ try {
+ val = faker[module][method]();
+ } catch (err) {
+
+ }
if (typeof val === "object") {
val = JSON.stringify(val, true, 2);
}