[spesmilo/electrum] Not enough funds error doesn’t fail gracefully (#4646)

When I’m using Electrum command line programmatically, trying to ‘payto’ an address when I don’t have enough funds causes the program to crash and return a traceback.

Is it possible to have Electrum fail gracefully in this situation, perhaps with a concise error message?

The problem is I’m running Electrum from other Python scripts using Check_output from Subprocess models and Electrum returning a traceback causes an exception.