CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

fix: Exception rework

Open kenjis opened this issue 1 year ago • 3 comments

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:

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

kenjis avatar Jan 28 '24 00:01 kenjis

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Jan 30 '24 23:01 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Feb 08 '24 21:02 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Feb 17 '24 03:02 github-actions[bot]

@codeigniter4/core-team Any comments?

kenjis avatar Feb 22 '24 00:02 kenjis

@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

najdanovicivan avatar Feb 23 '24 09:02 najdanovicivan

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.

kenjis avatar Feb 25 '24 02:02 kenjis

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 05 '24 05:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 09 '24 23:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 18 '24 01:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 25 '24 23:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Mar 30 '24 00:03 github-actions[bot]

:wave: Hi, @kenjis!

We detected conflicts in your PR against the base branch :speak_no_evil:
You may want to sync :arrows_counterclockwise: your branch with upstream!

Ref: Syncing Your Branch

github-actions[bot] avatar Apr 07 '24 04:04 github-actions[bot]