Commit ec6fc56e authored by Jocelyn Delalande's avatar Jocelyn Delalande

better compilation errr handling

parent a463bc4e
......@@ -329,14 +329,17 @@ class Texte(models.Model):
self.log = ""
try:
objet_source.compiler()
except Exception, erreur:
# Si l'on a pas de log de sortie, on se rabat sur le message d'erreur'
except Documents.exceptions.CompilationError as e:
try:
self.log = objet_source.log
except AttributeError:
self.log = erreur
raise Documents.exceptions.CompilationError, erreur
return False
self.log = e
raise e
except Exception as e:
# Si l'on a pas de log de sortie, on se rabat sur le message d'erreur'
self.log = e
raise Documents.exceptions.CompilationError, e
shutil.move(objet_source.pdf, self._build_pdf_path())
# Supprime les fichiers temporaires
......
......@@ -95,9 +95,9 @@ def compiler(requete,id,**args):
raise Documents.exceptions.CompilationError
# FIXME: manage to raise CompilationError
except Exception, e:
print e
except Documents.exceptions.CompilationError as e:
fw_valeurs = {'object':t, 'referer': requete.META.get('HTTP_REFERER')}
raise
return render_to_response('admin/texte/voir_log.html',fw_valeurs)
else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment