Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Database Error in wsfev1.py #70

Open
chazuttu opened this issue Jul 26, 2021 · 2 comments
Open

Internal Database Error in wsfev1.py #70

chazuttu opened this issue Jul 26, 2021 · 2 comments
Labels
good first issue Good for newcomers

Comments

@chazuttu
Copy link
Collaborator

chazuttu commented Jul 26, 2021

On execution the command in the main branch:

$ wsfev1 --parametros

the following output is received:

=== Tipos de Paises ===
FEParamGetTiposPaises'}}]}}
Traceback (most recent call last):
  File "C:\Users\pyafipws\py3\Scripts\wsfev1-script.py", line 33, in <module>
    sys.exit(load_entry_point('PyAfipWs===3.9.b-2522-', 'console_scripts', 'wsfev1')())
  File "C:\Users\\pyafipws\py3\lib\site-packages\pyafipws-3.9.b_2522_-py3.9.egg\pyafipws\wsfev1.py", line 1570, in main
    print(u"\n".join(wsfev1.ParamGetTiposPaises()))
  File "C:\Users\pyafipws\py3\lib\site-packages\pyafipws-3.9.b_2522_-py3.9.egg\pyafipws\utils.py", line 201, in capturar_errores_wrapper    
    return func(self, *args, **kwargs)
  File "C:\Users\py3\lib\site-packages\pyafipws-3.9.b_2522_-py3.9.egg\pyafipws\wsfev1.py", line 1228, in ParamGetTiposPaises       
    for p in res["ResultGet"]
KeyError: 'ResultGet'

on checking the return value ret, we find:
ret------ {'FEParamGetTiposPaisesResult': {'Errors': [{'Err': {'Code': 501, 'Msg': 'Error interno de base de datos: - Metodo

This seems to be an internal error, causing the failure for Tipos se Paises parameter.

@chazuttu chazuttu mentioned this issue Jul 26, 2021
6 tasks
@reingart reingart added the good first issue Good for newcomers label Mar 26, 2022
@baivab85
Copy link

baivab85 commented Apr 1, 2024

I think this code can fix it

def ParamGetTiposPaises():
try:
res = some_function_that_returns_dictionary()
tipos_paises = res.get("ResultGet", [])
for p in tipos_paises:
pass
return tipos_paises
except Exception as e:
print(f"An error occurred: {e}")
return []

@foramchudasama
Copy link

I think this code can fix it

def ParamGetTiposPaises():
try:
res = some_function_that_returns_dictionary()
tipos_paises = res.get("ResultGet", [])
for p in tipos_paises:
pass
return tipos_paises
except Exception as e:
print(f"An error occurred: {e}")
return []

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants