eyeonus / Trade-Dangerous

Mozilla Public License 2.0
96 stars 31 forks source link

The search for specific goods generates an error ! Function "buy" #153

Closed nepomuk16321 closed 2 months ago

nepomuk16321 commented 2 months ago

image

kfsone commented 2 months ago

looking

kfsone commented 2 months ago

@eyeonus with

python ./trade.py buy -w --near="Amber/Felice Plant" --ly=16.00 --pad=M --planetary=N --fc=N --limit=42 -vv "Bauxite"

to enable the full 'rich' error reporting and in a nutshell I appear to have left a trailing comma that turned a string into a tuple. image

eyeonus commented 2 months ago

How did you enable rich reporting, and how do we make it do that by default? It seems super useful to have it use that on clients' instances so that they can send that rather than the somewhat less informative error message such as @nepomuk16321's

kfsone commented 2 months ago

Let me walk myself thru it for synchronization:

tradeenv.py will enable the "tame" version of it: https://github.com/eyeonus/Trade-Dangerous/blob/release/v1/tradedangerous/tradeenv.py#L31-L34 if you set EXCEPTIONS. unix-shell: EXCEPTIONS =1 trade.py makemerich powershell: $env:EXCEPTIONS = 1; trade.py makebillgatesrich (* I'm actually a powershell user and fan)

and by -w here https://github.com/eyeonus/Trade-Dangerous/blob/release/v1/tradedangerous/tradeenv.py#L209-L210

https://rich.readthedocs.io/en/latest/traceback.html

apparently they have a print_exception flavor too that lets you target specific exceptions with more detail, so if there's a problem scenario where a particular exception is being triggered in unknown circumstances, just that particular exception can be turned into hyper-spam

I didn't want to enable it by default on you because some pythonistas will (╯‵□′)╯︵┻━┻ at the sight of their beautified backtrace dark mumbo jumbo. imo they can always get a new one from ikea.

The extreme version is super noisy and spammy and I don't think you want it on by default, and I didn't spend the time to learn how to leverage more fine grained control, but it's enabled by "-w".

kfsone commented 2 months ago

if you want to see what it looks like - randomly drop a "raise Exception('you aint seen me')" somewhere in say the buy command and then trade.py buy -w ... - just don't expect to be able to find the top ...

kfsone commented 2 months ago

rich is seriously f'ing awesome.

eyeonus commented 2 months ago

Um, you meant EXCEPTIONS, didn't you?

kfsone commented 2 months ago

yar - I do, sorry. Worse, I retyped EXTENSIONS when I tried to fix it.

kfsone commented 2 months ago

I believe this is resolved, @nepomuk16321 ?

nepomuk16321 commented 2 months ago

Yes, it works again. I still had an error during the first test in which an unknown system was announced. I then removed this system from the price list. On the second attempt, everything worked without any problems. The desired list was displayed. Thank you both for your efforts! :-)