brpaz / ulauncher-currency

Ulauncher Extension to convert an amount between currencies. Conversion rates provided by Fixer.
MIT License
10 stars 7 forks source link

[Bug]: Fixer has Currency API under a subscription now. #15

Open ishmeet1995 opened 1 year ago

ishmeet1995 commented 1 year ago

Description?

While using free api I always get the below error. Upon further investigation it seems like the pricing mode for Fixer has changed. Now currency conversion is paid. https://apilayer.com/marketplace/fixer-api#pricing

Extension Logs

traceback (most recent call last):
  File "/home/ishmeet1995/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-currency/main.py", line 85, in on_event
    value = extension.convert_currency(amount, from_currency,
  File "/home/ishmeet1995/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-currency/main.py", line 46, in convert_currency
    raise ConversionException(response['error']['info'])
ConversionException: You have not supplied a valid API Access Key. [Technical Support: support@apilayer.com]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Client.py", line 54, in on_message
    self.extension.trigger_event(event)
  File "/usr/lib/python3/dist-packages/ulauncher/api/client/Extension.py", line 52, in trigger_event
    action = listener.on_event(event, self)
  File "/home/ishmeet1995/.local/share/ulauncher/extensions/com.github.brpaz.ulauncher-currency/main.py", line 101, in on_event
    description=e.message,
AttributeError: 'ConversionException' object has no attribute 'message'
brunofunnie commented 1 year ago

@ishmeet1995 I created a PR for it, let's pray so @brpaz approve it, but you still need to register on API Layer platform, it'll give you a free key with 100 requests limit (monthly) what is ok for a regular use (3 requests a day kinda of).

Maybe an improvement would be implement some cache for the requests with same currencies with adjustable TTL