error handling

This commit is contained in:
Manuel Friedli 2015-03-26 17:58:42 +01:00
parent a9aa739a3e
commit 90b28c793b

View file

@ -36,7 +36,11 @@
"id": "decodeuri",
"name": "Decode URI",
"convert": function(input) {
try {
return decodeURI(input)
} catch (exception) {
return "Invalid URI string.";
}
}
},
{
@ -52,7 +56,11 @@
"id": "decodeuricomponent",
"name": "Decode URI component",
"convert": function(input) {
try {
return decodeURIComponent(input)
} catch (exception) {
return "Invalid URI component string.";
}
}
}
];