Repository navigation
feat(exception): add InvalidDataThrowable marker interface - #6
Open
TDannhauer wants to merge 1 commit into
Open
TDannhauer wants to merge 1 commit into
TDannhauer wants to merge 1 commit into
Conversation
Marks exceptions caused by invalid data supplied by the caller (as opposed to a failure of the server), so consumers such as protocol handlers can tell "do not retry this item" from "try again later" without depending on the concrete exception classes of an application. Same pattern as PermissionDeniedThrowable. First implementer is Turba_Exception_InvalidAttribute (horde/turba#73).
This was referenced Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Horde\Exception\InvalidDataThrowable(extendsHordeThrowable), following thePermissionDeniedThrowablepattern.Motivation
Applications throw their own exception classes when a caller supplies data they cannot store (a Turba attribute over its configured
maxlength, for example). Protocol handlers in other packages —Horde_Core_ActiveSync_Driverin this case — need to distinguish "the client's data is invalid, do not retry" from "the server failed, try again" without depending onTurba_*classes. A framework-level marker interface keeps that check implementation-agnostic.Context: horde/turba#73 (attribute constraints only enforced in the web form; ActiveSync clients resend a rejected contact forever because it is reported as a server error).
Changes
src/InvalidDataThrowable.php— empty marker interface with docblock describing the contract (the exception message describes the invalid input; retrying with the same input will fail again).Related PRs
Turba_Exception_InvalidAttribute implements InvalidDataThrowableInvalidDataThrowableto ActiveSyncSTATUS_INVALIDNote for release: adding the interface is a minor-version feature; the dependent packages currently require
horde/exception: ^3 || dev-FRAMEWORK_6_0and will need^3.1(or whichever version ships this) once released.Test plan
php -l src/InvalidDataThrowable.phpTurba_Exception_InvalidAttribute instanceof InvalidDataThrowable)