AnswerDotAI / AnswerDotAI/ghapi

Return error description functionality

Aperta
#138 2 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
685
Fork
70
Merge medio
1m
PR unite (30g)
2

Descrizione

Hey guys,

Do you know if is possible get the error message in Python instead a generic error message?

If yes, please let me know. If not, could be a good solution to help troubleshooting.

Expected error output:
**Error: Branch feature/test-api-github2 not found**
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\ghapi\core.py", line 63, in __call__
return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
File "C:\Users\victo\AppData\Roaming\Python\Python310\site-packages\ghapi\core.py", line 112, in __call__
res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\fastcore\net.py", line 212, in urlsend
return urlread(req, return_json=return_json, return_headers=return_headers)
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\fastcore\net.py", line 113, in urlread
if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None

Current the error output:
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\ghapi\core.py", line 63, in __call__
return self.client(self.path, self.verb, headers=headers, route=route_p, query=query_p, data=data_p)
File "C:\Users\victo\AppData\Roaming\Python\Python310\site-packages\ghapi\core.py", line 112, in __call__
res,self.recv_hdrs = urlsend(path, verb, headers=headers or None, debug=self.debug, return_headers=True,
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\fastcore\net.py", line 212, in urlsend
return urlread(req, return_json=return_json, return_headers=return_headers)
File "C:\Users\xxx\AppData\Roaming\Python\Python310\site-packages\fastcore\net.py", line 113, in urlread
if 400 <= e.code < 500: raise ExceptionsHTTP[e.code](e.url, e.hdrs, e.fp) from None

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Reproduce the missing-branch error and read ghapi/core.py around lines 63 and 112, then trace the fastcore/net.py locations shown in the report. Determine where the GitHub error description is discarded; done means Python exposes the description instead of only the generic traceback.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
github, python
Ambito
api
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.