summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-06-06 17:05:00 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-06-06 17:05:00 +0200
commita6f76d89efaa561a587290c8a6339fd0b9ebf63d (patch)
tree550a4f7f407dcc2ae63c12d418d1614aa8f29935 /bin
parent35577e1934ca191a277a528707a5312ec7169ac9 (diff)
Detect efa.vrr.de error messages
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/efa b/bin/efa
index 0670083..4a7f6eb 100755
--- a/bin/efa
+++ b/bin/efa
@@ -50,6 +50,24 @@ sub check_ambiguous {
}
}
+sub check_no_connections {
+ my ($full_tree) = @_;
+
+ my $xp_err_img = XML::LibXML::XPathExpression->new(
+ '//td/img[@src="images/ausrufezeichen.jpg"]');
+
+ my $err_node = $full_tree->findnodes($xp_err_img)->[0];
+
+ if ($err_node) {
+ say "Looks like efa.vrr.de showed an error.";
+ say "I will now try to dump the error message:";
+
+ say $err_node->parentNode()->parentNode()->textContent();
+
+ exit 2;
+ }
+}
+
sub display_connection {
my ($con_parts) = @_;
@@ -340,6 +358,7 @@ if ($test_dump) {
my $tree = XML::LibXML->load_html(string => $content);
check_ambiguous($tree);
+check_no_connections($tree);
$connections = parse_tree($tree);