Skip to content

fix: Exception rework#8470

Closed
kenjis wants to merge 29 commits intocodeigniter4:4.5from
kenjis:exceptions-rework
Closed

fix: Exception rework#8470
kenjis wants to merge 29 commits intocodeigniter4:4.5from
kenjis:exceptions-rework

Conversation

@kenjis
Copy link
Member

@kenjis kenjis commented Jan 28, 2024

Description
See #4358

  • add new Exception classes in CodeIgniter\Exceptions
    • LogicException
    • RuntimeException
    • BadFunctionCallException
    • BadMethodCallException
    • InvalidArgumentException
  • add domain-level ExceptionInterface to catch all Exceptions in the domain
    • Files
    • HTTP
    • Router

exceptions-database-class-dia

  • all Exception classes that the framework throws
    • implement CodeIgniter\Exceptions\ExceptionInterface
    • extend \Exception (not \Error)
    • extend \LogicException or \RuntimeException

exceptions-class-dia

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added the 4.5 label Jan 28, 2024
@kenjis kenjis marked this pull request as draft January 28, 2024 00:56
@kenjis kenjis changed the title Exception rework fix: Exception rework Jan 28, 2024
@kenjis kenjis force-pushed the exceptions-rework branch from 67f7c3d to 0da95c4 Compare January 28, 2024 01:16
@kenjis kenjis added bug Verified issues on the current code behavior or pull requests that will fix them enhancement PRs that improve existing functionalities breaking change Pull requests that may break existing functionalities labels Jan 28, 2024
@kenjis kenjis added the docs needed Pull requests needing documentation write-ups and/or revisions. label Jan 28, 2024
@kenjis kenjis force-pushed the exceptions-rework branch from 9e5fd45 to 6ccfab5 Compare January 29, 2024 06:17
@github-actions github-actions bot added the stale Pull requests with conflicts label Jan 30, 2024
@github-actions
Copy link

👋 Hi, @kenjis!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@kenjis kenjis force-pushed the exceptions-rework branch from 0c7bb92 to 495a862 Compare January 31, 2024 01:53
@kenjis kenjis removed the stale Pull requests with conflicts label Jan 31, 2024
@kenjis kenjis marked this pull request as ready for review January 31, 2024 02:52
@github-actions github-actions bot added the stale Pull requests with conflicts label Feb 8, 2024
@github-actions
Copy link

github-actions bot commented Feb 8, 2024

👋 Hi, @kenjis!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@kenjis kenjis force-pushed the exceptions-rework branch from 495a862 to 93f30f4 Compare February 9, 2024 01:32
@kenjis kenjis removed the stale Pull requests with conflicts label Feb 9, 2024
@github-actions github-actions bot added the stale Pull requests with conflicts label Feb 17, 2024
@github-actions
Copy link

👋 Hi, @kenjis!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@kenjis kenjis removed the stale Pull requests with conflicts label Feb 17, 2024
@kenjis
Copy link
Member Author

kenjis commented Feb 22, 2024

@codeigniter4/core-team Any comments?

@najdanovicivan
Copy link
Contributor

@kenjis I like this one especially LogicException and InvalidArgumentException

But it will be useful to add some explanation and use cases in docs as well on https://www.codeigniter.com/user_guide/general/errors.html#using-exceptions

@kenjis
Copy link
Member Author

kenjis commented Feb 25, 2024

I would like to document that LogicException means a bug in the app code,
so the code should be fixed when LogicException occurs,
and that LogicException should not be caught.

I would like to know if this PR may or may not be merged into 4.5.

@github-actions github-actions bot added the stale Pull requests with conflicts label Mar 5, 2024
@github-actions
Copy link

github-actions bot commented Mar 5, 2024

👋 Hi, @kenjis!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@kenjis kenjis force-pushed the exceptions-rework branch from 25b82c1 to 857ed27 Compare March 5, 2024 08:10
@kenjis kenjis removed the stale Pull requests with conflicts label Mar 5, 2024
kenjis added 23 commits March 30, 2024 17:35
If there are more than one Exception class in the domain,
provide a domain-level interface for capture of all exceptions.
@kenjis kenjis force-pushed the exceptions-rework branch from 7d23a81 to 459bb8f Compare March 30, 2024 08:35
@github-actions github-actions bot added the stale Pull requests with conflicts label Apr 7, 2024
@github-actions
Copy link

github-actions bot commented Apr 7, 2024

👋 Hi, @kenjis!

We detected conflicts in your PR against the base branch 🙊
You may want to sync 🔄 your branch with upstream!

Ref: Syncing Your Branch

@kenjis kenjis deleted the branch codeigniter4:4.5 April 7, 2024 04:47
@kenjis kenjis closed this Apr 7, 2024
@kenjis kenjis mentioned this pull request Apr 7, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Pull requests that may break existing functionalities bug Verified issues on the current code behavior or pull requests that will fix them docs needed Pull requests needing documentation write-ups and/or revisions. enhancement PRs that improve existing functionalities stale Pull requests with conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants