You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.
Currently, we are handling some exceptions in code shared between CLI and NRE as if they were used only in CLI (logging and returning empty output). For example:
\n😰 Whoops, looks like max fee is missing. Try with:\n
--max_fee=`MAX_FEE`
"""
)
return
else:
logging.error(err)
return
When account.send is called from scripts, if an exception occurs, the call will return an empty response, and the exception won't be raised. This can make the user confused about what is happening, as he probably won't be checking the logging output in a script.
I think we should, as a general rule, avoid try-catching and logging outside the CLI.
Also, I think it would be helpful to implement a class handling exceptions for the CLI as a centralized entity instead of different try/catches in multiple places.
This is helpful for UX and code maintainability and extensibility.
EDIT: The code preview is not showing all the lines I wanted, but if you go to that section, and check the catch block, you will see the empty return.
EDIT 2: I think this could relate to handling watch_mode in NRE (see this issue).
The text was updated successfully, but these errors were encountered:
Currently, we are handling some exceptions in code shared between CLI and NRE as if they were used only in CLI (logging and returning empty output). For example:
nile/src/nile/core/call_or_invoke.py
Lines 42 to 65 in 6643bcd
When
account.send
is called from scripts, if an exception occurs, the call will return an empty response, and the exception won't be raised. This can make the user confused about what is happening, as he probably won't be checking the logging output in a script.I think we should, as a general rule, avoid try-catching and logging outside the CLI.
Also, I think it would be helpful to implement a class handling exceptions for the CLI as a centralized entity instead of different try/catches in multiple places.
This is helpful for UX and code maintainability and extensibility.
EDIT: The code preview is not showing all the lines I wanted, but if you go to that section, and check the catch block, you will see the empty return.
EDIT 2: I think this could relate to handling
watch_mode
in NRE (see this issue).The text was updated successfully, but these errors were encountered: