google / google/python-fire

How can i access the exception that fire handles?

Aberta
#209 8 comentários 0 reações 0 responsáveis Ver no GitHub
Linguagem predominante
Python
Estrelas
28.2k
Forks
1.5k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

I know that whether I am using a class or a function, fire will internally handle the exception and show the help if there is an issue.

So considering `fire_obj = fire.Fire(SomeClass)`, how can I access that exception from fire_obj? I know that fire_obj points to a new instance of SomeClass, but I am trying to capture and handle the exceptions that fire is handling internally when it shows the help or exceptions.

When I wrap it in a try except, I can see that the exception is `FireExit`, but I dont want the python-fire help message to print (which is printing from the code in the library). I want to instead raise my own exception, but even better, access the exception that happened inside `SomeClass` which is trigger the error.

@dbieber

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.