Giter VIP home page Giter VIP logo

Comments (4)

shtlrs avatar shtlrs commented on August 15, 2024 1

We are catching this further up

              try:
                  with open(image_path, "wb") as out_file:
                      await self._generate_image(TEMPLATE.substitute(text=query), out_file)
              except InvalidLatexError as err:
                  embed = discord.Embed(title="Failed to render input.")
                  if err.logs is None:
                      embed.description = "No logs available."
                  else:
                      logs_paste_url = await self._upload_to_pastebin(err.logs)
                      if logs_paste_url:
                          embed.description = f"[View Logs]({logs_paste_url})"
                      else:
                          embed.description = "Couldn't upload logs."
                  await ctx.send(embed=embed)
                  image_path.unlink()
                  return

We say that we couldn't render the input, which I think is enough to close this.

from sir-lancebot.

shtlrs avatar shtlrs commented on August 15, 2024 1

Sure, I'll assign you.

As for the error message, what you've suggested or something like '' Server encountered an issue, please retry in a moment '' should do the job.

We can discuss this in the PR at the worst case.

from sir-lancebot.

wookie184 avatar wookie184 commented on August 15, 2024

We're only catching the InvalidLatexError, which wont be raised in the case of a 5xx exception (since a ClientResponseError will be raised before the line we raise that error is reached).

Also, I think it's worth distinguishing between errors with a user's input, and error's with the server.

from sir-lancebot.

MedAliMarz avatar MedAliMarz commented on August 15, 2024

I would like to work on this issue, yet what would be a good user message in that case ?
I suggest : "Rendering server is unavailable, please try again later"

from sir-lancebot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.