Merge pull request #66 from TheKrush/krush

clear market errors after success
master
Brandon Lee Camilleri 5 years ago committed by GitHub
commit d1946a1dec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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