Trade-Dangerous icon indicating copy to clipboard operation
Trade-Dangerous copied to clipboard

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

Open nepomuk16321 opened this issue 10 months ago • 9 comments

image

nepomuk16321 avatar May 01 '24 17:05 nepomuk16321

looking

kfsone avatar May 01 '24 18:05 kfsone

@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

kfsone avatar May 01 '24 18:05 kfsone

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

eyeonus avatar May 01 '24 19:05 eyeonus

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 avatar May 01 '24 19:05 kfsone

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 avatar May 01 '24 19:05 kfsone

rich is seriously f'ing awesome.

kfsone avatar May 01 '24 19:05 kfsone

Um, you meant EXCEPTIONS, didn't you?

eyeonus avatar May 01 '24 19:05 eyeonus

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

kfsone avatar May 02 '24 00:05 kfsone

I believe this is resolved, @nepomuk16321 ?

kfsone avatar May 04 '24 18:05 kfsone

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! :-)

nepomuk16321 avatar May 05 '24 18:05 nepomuk16321