joshuaulrich / quantmod

Quantitative Financial Modelling Framework
http://www.quantmod.com/
GNU General Public License v3.0
818 stars 224 forks source link

Hide API keys in error messages #286

Closed joshuaulrich closed 4 years ago

joshuaulrich commented 4 years ago

Error messages contain API keys in plain text. This is a problem for tests that are run on TravisCI, or any other CI platform where the logs are public.

Here are a couple examples:

quantmod::getQuote(c("FOO", "WYSIWYG"), src = "av", api.key = v)
Error in getQuote.av(Symbols = c("FOO", "WYSIWYG"), api.key = "[redacted]") : 
  No data for symbols: FOO, WYSIWYG

quantmod::getQuote(c("FOO", "WYSIWYG"), src = "tiingo", api.key = k)
Error in getQuote.tiingo(Symbols = c("FOO", "WYSIWYG"), api.key = "[redacted]") : 
  No data for symbols: FOO, WYSIWYG

The fix may be as easy as setting call. = FALSE in the call to stop().