diff --git a/dencoder.js b/dencoder.js index 615cf0a..033bd64 100644 --- a/dencoder.js +++ b/dencoder.js @@ -36,7 +36,11 @@ "id": "decodeuri", "name": "Decode URI", "convert": function(input) { - return decodeURI(input) + try { + return decodeURI(input) + } catch (exception) { + return "Invalid URI string."; + } } }, { @@ -52,7 +56,11 @@ "id": "decodeuricomponent", "name": "Decode URI component", "convert": function(input) { - return decodeURIComponent(input) + try { + return decodeURIComponent(input) + } catch (exception) { + return "Invalid URI component string."; + } } } ];