Merge pull request #16484 from netchampfaris/add-logging-for-failed-exchange-rate

chore: Add error logging for failed get_exchange_rate call
This commit is contained in:
Nabin Hait 2019-01-25 10:33:03 +05:30 committed by GitHub
commit cce96758fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
cache.setex(key, value, 6 * 60 * 60) cache.setex(key, value, 6 * 60 * 60)
return flt(value) return flt(value)
except: except:
frappe.log_error(title="Get Exchange Rate")
frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date)) frappe.msgprint(_("Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually").format(from_currency, to_currency, transaction_date))
return 0.0 return 0.0