diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-06 17:05:00 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-06 17:05:00 +0200 |
commit | a6f76d89efaa561a587290c8a6339fd0b9ebf63d (patch) | |
tree | 550a4f7f407dcc2ae63c12d418d1614aa8f29935 /bin | |
parent | 35577e1934ca191a277a528707a5312ec7169ac9 (diff) |
Detect efa.vrr.de error messages
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -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); |