Update functions.py
Browse files- functions.py +4 -4
functions.py
CHANGED
|
@@ -10,10 +10,10 @@ def cargar_modalidades_tareas():
|
|
| 10 |
with open("modalidades_tareas.json", "r") as file:
|
| 11 |
MODALIDAD_TAREAS = json.load(file)
|
| 12 |
return MODALIDAD_TAREAS
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
|
| 18 |
# Validar el diccionario de modalidades y tareas
|
| 19 |
def validar_modalidades_tareas(modalidades_tareas):
|
|
|
|
| 10 |
with open("modalidades_tareas.json", "r") as file:
|
| 11 |
MODALIDAD_TAREAS = json.load(file)
|
| 12 |
return MODALIDAD_TAREAS
|
| 13 |
+
except FileNotFoundError:
|
| 14 |
+
raise ValueError("El archivo 'modalidades_tareas.json' no se encontr贸. Aseg煤rate de que existe en el directorio correcto.")
|
| 15 |
+
except json.JSONDecodeError:
|
| 16 |
+
raise ValueError("El archivo 'modalidades_tareas.json' tiene un formato incorrecto. Verifica que sea un JSON v谩lido.")
|
| 17 |
|
| 18 |
# Validar el diccionario de modalidades y tareas
|
| 19 |
def validar_modalidades_tareas(modalidades_tareas):
|