1
0
Эх сурвалжийг харах

latoc.tcl: Raise error if parsing fails

Will Storey 7 жил өмнө
parent
commit
f4b3059866
1 өөрчлөгдсөн 4 нэмэгдсэн , 1 устгасан
  1. 4 1
      latoc.tcl

+ 4 - 1
latoc.tcl

@@ -52,7 +52,10 @@ proc ::latoc::fetch {chan} {
 proc ::latoc::parse {data} {
 	set lines []
 	foreach stock [regexp -all -inline -- $::latoc::list_regexp $data] {
-		regexp $::latoc::stock_regexp $stock -> symbol name price last change percent volume interest
+		if {![regexp $::latoc::stock_regexp $stock -> symbol name price last change percent volume interest]} {
+			error "error parsing HTML"
+		}
+
 		set direction none
 		if {$change < 0} {
 			set direction Down