From 1ae5e4b5b5630fd25912b2c52a9d682b5243d579 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Sat, 25 Feb 2012 22:57:19 -0500 Subject: [PATCH] Don't need to actually catch any exceptions there... --- src/web.d | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/web.d b/src/web.d index e0b2073..134bd4a 100755 --- a/src/web.d +++ b/src/web.d @@ -93,13 +93,11 @@ void do_content(string url) { html_push("
"); // first, see if we have something that wants to handle url outright foreach (StaticRegex!char reg, string h; handlers) { - try { - if (match(url, reg)) { - html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url)); - html_pop("
"); - return; - } - } catch (std.regex.RegexException re) { continue; } + if (match(url, reg)) { + html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url)); + html_pop(""); + return; + } } // if that failed, see if we can handle the file if (url == "" ? true : url[$-1] == '/') url ~= "index"; @@ -108,13 +106,11 @@ void do_content(string url) { string name = baseName(f); name = name[0] == '@' ? name[1..$] : name; if (stripExtension(name) == baseName(url)) { foreach (StaticRegex!char reg, string h; handlers) { - try { - if (match(name, reg)) { - html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f)); - html_pop(""); - return; - } - } catch (std.regex.RegexException re) { continue; } + if (match(name, reg)) { + html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f)); + html_pop(""); + return; + } } } }