Dear Gnucash developers, Following issue 796970, I believe it would be better for the user to be warned by Gnucash when the user tries to update currencies without providing an Alphavantage API key. For now, Gnucash silently does nothing in this case, which is confusing for the user. Wouldn't it be possible to catch the Finance::quote error that appears with the following? $ gnc-fq-dump -v alphavantage T Finance::Quote fields Gnucash uses: symbol: T (deduced) <=== required date: ** missing ** <=== recommended currency: ** missing ** <=== required last: <=\ nav: <=== one of these price: <=/ timezone: <=== optional ** This stock quote cannot be used by GnuCash! All fields returned by Finance::Quote for stock T stock field value ----- ----- ----- T errormsg: Expected ALPHAVANTAGE_API_KEY to be set; get an API key at https://www.alphavantage.co T last: **missing** T nav: **missing** T price: **missing** T success: 0 Best, Bertrand
This would have to be done by a scheme programmer as gnc-fq-helper is called from src/gnucash/price-quotes.scm. Not me I'm afraid. It would also have to cater for running 'gnucash --add-price-quotes=FILE' which does not have a gui.
It's not possible for GnuCash to discover why a particular price request fails, Finance::Quote doesn't say and in most cases can't tell anyway because the quote supplier just returns an http error code. What GnuCash could do is detect that the user is requesting an Alphavantage quote and that the key isn't set. That would be done in Perl for gnc-fq-dumper and in C for the Get Quotes button.
The other way: Before starting the request check for usage of sources Alphavantage or currency. If at least one is used, check for an existing Alphavantage key. If none is found throw an errormessage.
I have added https://github.com/Gnucash/gnucash/pull/729 (master) which modifies gnc-fq-dump to give an err msg if ALPHAVANTAGE_API_KEY is needed but missing. John Ralls, I wasn't sure if it would be acceptable to modify the C program to give a warning when the Get Quotes button is used as that would have to duplicate a lot of the processing done by price-quotes.scm. Ideally, I think price-quotes.scm should be rewritten in C++ but that is beyond me. If you think the warning would be OK from the C program when Get Quotes button is used, I'll do that.
Chris, if you think you can manage the price-source check in gnc_prices_dialog_get_quotes_clicked go right ahead.
Chris's PR is merged for tomorrow's 3.905 release.