Don't need to actually catch any exceptions there...

This commit is contained in:
Luqman Aden 2012-02-25 22:57:19 -05:00
parent 259b9f6476
commit 1ae5e4b5b5
1 changed files with 10 additions and 14 deletions

View File

@ -93,13 +93,11 @@ void do_content(string url) {
html_push("<div id=\"main-copy\"" ~ (nav_tree_vert? " class=\"main-copy-side-bar\"" : "") ~ ">"); html_push("<div id=\"main-copy\"" ~ (nav_tree_vert? " class=\"main-copy-side-bar\"" : "") ~ ">");
// first, see if we have something that wants to handle url outright // first, see if we have something that wants to handle url outright
foreach (StaticRegex!char reg, string h; handlers) { foreach (StaticRegex!char reg, string h; handlers) {
try { if (match(url, reg)) {
if (match(url, reg)) { html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url));
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ url)); html_pop("</div>");
html_pop("</div>"); return;
return; }
}
} catch (std.regex.RegexException re) { continue; }
} }
// if that failed, see if we can handle the file // if that failed, see if we can handle the file
if (url == "" ? true : url[$-1] == '/') url ~= "index"; 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; string name = baseName(f); name = name[0] == '@' ? name[1..$] : name;
if (stripExtension(name) == baseName(url)) { if (stripExtension(name) == baseName(url)) {
foreach (StaticRegex!char reg, string h; handlers) { foreach (StaticRegex!char reg, string h; handlers) {
try { if (match(name, reg)) {
if (match(name, reg)) { html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f));
html(shell(dweb_root ~ "/bin/" ~ h ~ " " ~ f)); html_pop("</div>");
html_pop("</div>"); return;
return; }
}
} catch (std.regex.RegexException re) { continue; }
} }
} }
} }