Skip to content

Commit

Permalink
Supprime les fils d'Ariane pour Sentry dans publication_utils.py
Browse files Browse the repository at this point in the history
- les fils d'Ariane n'aportent pas d'information supplémentaire,
  Sentry intercepte déjà les appels à Popen et les met dans le fil
  d'Ariane
- la fonction add_breadcumb() était mal appelée et causait des
  avertissement de Sentry : "Sentry has identified the following
  problems for you to monitor: Discarded invalid value (3), expected an
  object"
  • Loading branch information
philippemilink committed Jul 13, 2024
1 parent 58486b4 commit c6315bf
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions zds/tutorialv2/publication_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,6 @@ def tex_compiler(self, texfile, draftmode: str = ""):
)
# let's put 10 min of timeout because we do not generate latex everyday
command_process.communicate(timeout=600)
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="lualatex call", data=command, type="cmd")

pdf_file_path = path.splitext(texfile)[0] + self.extension
return path.exists(pdf_file_path)
Expand All @@ -475,10 +471,7 @@ def make_glossary(self, basename, texfile):
command, shell=True, cwd=path.dirname(texfile), stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
std_out, std_err = command_process.communicate()
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="makeglossaries call", data=command, type="cmd")
# TODO: check makeglossary exit codes to see if we can enhance error detection
if "fatal" not in std_out.decode("utf-8").lower() and "fatal" not in std_err.decode("utf-8").lower():
return True
Expand All @@ -504,10 +497,6 @@ def handle_tex_compiler_error(latex_file_path, ext):

errors = "\n".join(lines)
logger.debug("%s ext=%s", errors, ext)
with contextlib.suppress(ImportError):
import sentry_sdk

sentry_sdk.add_breadcrumb(message="luatex call", data=errors, type="cmd")

raise FailureDuringPublication(errors)

Expand Down

0 comments on commit c6315bf

Please sign in to comment.