clear market errors after success

master
Keith Yates 5 years ago
parent d1305eb791
commit 885c16421c
  1. 2
      cnn_market.go
  2. 2
      yahoo_quotes.go

@ -88,6 +88,8 @@ func (market *Market) Fetch() (self *Market) {
defer func() { defer func() {
if err := recover(); err != nil { if err := recover(); err != nil {
market.errors = fmt.Sprintf("Error fetching market data...\n%s", err) market.errors = fmt.Sprintf("Error fetching market data...\n%s", err)
} else {
market.errors = ""
} }
}() }()

@ -73,6 +73,8 @@ func (quotes *Quotes) Fetch() (self *Quotes) {
defer func() { defer func() {
if err := recover(); err != nil { if err := recover(); err != nil {
quotes.errors = fmt.Sprintf("\n\n\n\nError fetching stock quotes...\n%s", err) quotes.errors = fmt.Sprintf("\n\n\n\nError fetching stock quotes...\n%s", err)
} else {
market.errors = ""
} }
}() }()

Loading…
Cancel
Save