FAQ

I would like to propose the introduction of an 'InvalidStateException'
into the SPL extension. Within the existing exceptions I am not able
to find a type that would represent a state error, throwable if a
method has been invoked at an illegal or inappropriate time.
Exceptions are one part of the SPL that are a nasty, poorly thought-out
mess (no offense to anyone who worked on it; this stuff is harder than
people realize). I am -1 on simply adding another exception to our mess,
but if we can clean it up then I might support it, depending on details.

I'd love to listen your ideas/suggestions. Maybe we can implement an RFC
to make it better.
Without exposure to problems, there are no problems at all.

I'm not saying it's perfect, but would love ideas on how we can improve
it. =)
As an example of my idea of progress:
https://github.com/morrisonlevi/Ardent/blob/master/Exceptions.md

    - DomainException
    - FunctionException
    - LookupException (The two sub-classes here may be unnecessary; just one
    may do)
       - IndexException
       - KeyException
    - StateException
       - EmptyException
       - FullException
    - TypeException

Of course, this is not backwards compatible. It does, however, include a
StateException that is relevant here. I'm not implying that my exceptions
hierarchy is complete, but a good deal of thought and use has gone into
them so far.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 14 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedOct 17, '13 at 1:30p
activeOct 17, '13 at 6:10p
posts14
users5
websitephp.net

People

Translate

site design / logo © 2022 Grokbase