Skip to content

Conversation

@V3ntus
Copy link
Contributor

@V3ntus V3ntus commented Jun 12, 2022

About

This pull request rewrites the error handler to properly parse and print out a formatted error message.

We can all agree the 50035 is annoying. The information is extremely vague, unless you turn on debug logging. This fix aims to change that

Checklist

  • I've ran pre-commit to format and lint the change(s) made.
  • I've checked to make sure the change(s) work on 3.8.6 and higher.
  • This fixes/solves an Issue.
    • (If existent):
  • I've made this pull request for/as: (check all that apply)
    • Documentation
    • Breaking change
    • New feature/enhancement
    • Bugfix

i0bs and others added 20 commits April 5, 2022 15:02
chore!: pre-release for 4.1.1-rc.1
This file was actually cloned outside of the client directory in a PR that had not appropriately adjusted to the new architectural layout of the library.
This is an executive decision made between Delta and I. We will be forcing a version 4.0 push onto our old branch to help transition old users using v3 to our new project. This does not necessarily mean this branch will now be receiving updates along with the rest. The goal is to make our current branch used as much as possible.
refactor: Change all imports and `raise`s to `LibraryException`
Copy link
Contributor

@Toricane Toricane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of suggestions

@EepyElvyra EepyElvyra mentioned this pull request Jun 12, 2022
8 tasks
V3ntus and others added 4 commits June 12, 2022 13:51
Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
@EepyElvyra EepyElvyra linked an issue Jun 12, 2022 that may be closed by this pull request
1 task
Co-authored-by: Toricane <73972068+Toricane@users.noreply.github.com>
@V3ntus V3ntus requested a review from Toricane June 12, 2022 19:03
Copy link
Contributor

@Toricane Toricane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running Sphinx v5.0.1

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/application.py", line 202, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 165, in read
    namespace = eval_config_file(filename, tags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 356, in eval_config_file
    raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)


Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fbcf709d6a0>

Read the Docs build failed lol

@EepyElvyra
Copy link
Contributor

Running Sphinx v5.0.1

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/cmd/build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/application.py", line 202, in __init__
    self.config = Config.read(self.confdir, confoverrides or {}, self.tags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 165, in read
    namespace = eval_config_file(filename, tags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 356, in eval_config_file
    raise ConfigError(msg % traceback.format_exc()) from exc
sphinx.errors.ConfigError: There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)


Configuration error:
There is a programmable error in your configuration file:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/envs/848/lib/python3.8/site-packages/sphinx/config.py", line 343, in eval_config_file
    exec(code, namespace)
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/docs/conf.py", line 18, in <module>
    from interactions.base import __version__
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/__init__.py", line 12, in <module>
    from .client import *  # noqa: F401 F403 isort: skip
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/__init__.py", line 8, in <module>
    from .context import *  # noqa: F401 F403
  File "/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/client/context.py", line 4, in <module>
    from ..api import InteractionException
ImportError: cannot import name 'InteractionException' from 'interactions.api' (/home/docs/checkouts/readthedocs.org/user_builds/interactionspy/checkouts/848/interactions/api/__init__.py)

Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x7fbcf709d6a0>

Read the Docs build failed lol

Saw it, I'm on making a pr

@V3ntus
Copy link
Contributor Author

V3ntus commented Jun 12, 2022

Oh boy, ok I'll fiddle with it

EepyElvyra and others added 2 commits June 12, 2022 21:05
@Toricane Toricane self-requested a review June 12, 2022 19:11
Copy link
Contributor

@Toricane Toricane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@EepyElvyra EepyElvyra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with toricane

@EepyElvyra EepyElvyra merged commit 06f4924 into interactions-py:unstable Jun 12, 2022
@EepyElvyra EepyElvyra mentioned this pull request Jun 13, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] Better error handling.

5 participants