Skip to content

Discussion: Exception Design #4358

@kenjis

Description

@kenjis

The current exception classes are not neatly categorized, and when creating a new exception class, it is difficult to determine which exceptions to inherit and implement.

Also, when throwing exceptions, it is sometimes difficult to determine which exceptions to throw.

Click and see the class diagram:
class dia
source

In addition, the following questions arise.

  • What is the difference between AlertError, CriticalError, and EmergencyError?
  • What is the difference between an exception that extends Error and an exception that extends Exception?
  • What is the difference between exceptions placed in CodeIgniter/Exceptions/ and exceptions placed in components such as CodeIgniter/Filters/?
  • In what cases do we implement ExceptionInterface?
  • What is the FrameworkException?
  • Do we need CodeIgniter\Cache\Exceptions\ExceptionInterface?
  • Shouldn't there be LogicException?

Another problem that has been found is that the exceptions thrown by database-related classes are disparate and not standardized. See #4331

It seems to me that we need to classify the exception classes in a way that is easy to understand, and also indicate what kind of exceptions we throw.

What are your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions