Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\RestApi\Application\UseCases\UseCaseError Class Reference
+ Inheritance diagram for Wikibase\Repo\RestApi\Application\UseCases\UseCaseError:
+ Collaboration diagram for Wikibase\Repo\RestApi\Application\UseCases\UseCaseError:

Public Member Functions

 __construct (string $code, string $message, array $context=[])
 
 getErrorCode ()
 
 getErrorMessage ()
 
 getErrorContext ()
 

Static Public Member Functions

static newInvalidValue (string $path)
 
static newPatchResultInvalidValue (string $path, $value)
 
static newMissingField (string $path, string $field)
 
static newMissingFieldInPatchResult (string $path, string $field)
 
static newValueTooLong (string $path, int $maxLength, bool $isPatchRequest=false)
 
static newInvalidKey (string $path, string $key)
 
static newPatchResultInvalidKey (string $path, string $key)
 
static newDataPolicyViolation (string $violationCode, array $violationContext)
 
static newPatchResultModifiedReadOnlyValue (string $path)
 
static newPermissionDenied (string $reason)
 
static newResourceNotFound (string $resourceType)
 
static newPatchResultResourceNotFound (string $path, string $value)
 

Public Attributes

const CANNOT_MODIFY_READ_ONLY_VALUE = 'cannot-modify-read-only-value'
 
const DATA_POLICY_VIOLATION = 'data-policy-violation'
 
const INVALID_KEY = 'invalid-key'
 
const INVALID_PATH_PARAMETER = 'invalid-path-parameter'
 
const INVALID_QUERY_PARAMETER = 'invalid-query-parameter'
 
const INVALID_VALUE = 'invalid-value'
 
const ITEM_NOT_FOUND = 'item-not-found'
 
const ITEM_REDIRECTED = 'redirected-item'
 
const ITEM_STATEMENT_ID_MISMATCH = 'item-statement-id-mismatch'
 
const MISSING_FIELD = 'missing-field'
 
const PATCH_RESULT_INVALID_KEY = 'patch-result-invalid-key'
 
const PATCH_RESULT_INVALID_VALUE = 'patch-result-invalid-value'
 
const PATCH_RESULT_MISSING_FIELD = 'patch-result-missing-field'
 
const PATCH_RESULT_MODIFIED_READ_ONLY_VALUE = 'patch-result-modified-read-only-value'
 
const PATCH_RESULT_REFERENCED_RESOURCE_NOT_FOUND = 'patch-result-referenced-resource-not-found'
 
const PATCH_RESULT_VALUE_TOO_LONG = 'patch-result-value-too-long'
 
const PATCH_TARGET_NOT_FOUND = 'patch-target-not-found'
 
const PATCH_TEST_FAILED = 'patch-test-failed'
 
const PATCHED_INVALID_SITELINK_TYPE = 'patched-invalid-sitelink-type'
 
const PATCHED_SITELINK_URL_NOT_MODIFIABLE = 'url-not-modifiable'
 
const PATCHED_STATEMENT_GROUP_PROPERTY_ID_MISMATCH = 'patched-statement-group-property-id-mismatch'
 
const PERMISSION_DENIED = 'permission-denied'
 
const PERMISSION_DENIED_REASON_UNAUTHORIZED_BOT_EDIT = 'unauthorized-bot-edit'
 
const PERMISSION_DENIED_REASON_PAGE_PROTECTED = 'resource-protected'
 
const PERMISSION_DENIED_REASON_USER_BLOCKED = 'blocked-user'
 
const PERMISSION_DENIED_UNKNOWN_REASON = 'permission-denied-unknown-reason'
 
const POLICY_VIOLATION_ITEM_LABEL_DESCRIPTION_DUPLICATE = 'item-label-description-duplicate'
 
const POLICY_VIOLATION_PROPERTY_LABEL_DUPLICATE = 'property-label-duplicate'
 
const POLICY_VIOLATION_LABEL_DESCRIPTION_SAME_VALUE = 'label-description-same-value'
 
const POLICY_VIOLATION_SITELINK_CONFLICT = 'sitelink-conflict'
 
const PROPERTY_NOT_FOUND = 'property-not-found'
 
const PROPERTY_STATEMENT_ID_MISMATCH = 'property-statement-id-mismatch'
 
const RESOURCE_NOT_FOUND = 'resource-not-found'
 
const SITELINK_TITLE_NOT_FOUND = 'title-does-not-exist'
 
const STATEMENT_GROUP_PROPERTY_ID_MISMATCH = 'statement-group-property-id-mismatch'
 
const UNEXPECTED_ERROR = 'unexpected-error'
 
const VALUE_TOO_LONG = 'value-too-long'
 
const CONTEXT_ACTUAL_VALUE = 'actual_value'
 
const CONTEXT_CONFLICTING_ITEM_ID = 'conflicting_item_id'
 
const CONTEXT_CONFLICTING_PROPERTY_ID = 'conflicting_property_id'
 
const CONTEXT_DESCRIPTION = 'description'
 
const CONTEXT_FIELD = 'field'
 
const CONTEXT_ITEM_ID = 'item_id'
 
const CONTEXT_KEY = 'key'
 
const CONTEXT_LABEL = 'label'
 
const CONTEXT_LANGUAGE = 'language'
 
const CONTEXT_LIMIT = 'limit'
 
const CONTEXT_PARAMETER = 'parameter'
 
const CONTEXT_PATH = 'path'
 
const CONTEXT_PROPERTY_ID = 'property_id'
 
const CONTEXT_REASON = 'reason'
 
const CONTEXT_REDIRECT_TARGET = 'redirect_target'
 
const CONTEXT_RESOURCE_TYPE = 'resource_type'
 
const CONTEXT_SITE_ID = 'site_id'
 
const CONTEXT_STATEMENT_GROUP_PROPERTY_ID = 'statement_group_property_id'
 
const CONTEXT_STATEMENT_ID = 'statement_id'
 
const CONTEXT_STATEMENT_PROPERTY_ID = 'statement_property_id'
 
const CONTEXT_TITLE = 'title'
 
const CONTEXT_VALUE = 'value'
 
const CONTEXT_VIOLATION = 'violation'
 
const CONTEXT_VIOLATION_CONTEXT = 'violation_context'
 
const EXPECTED_CONTEXT_KEYS
 

Private Attributes

const ADDITIONAL_PATH_CONTEXT
 Depending on the use case and whether it's operating on a single resource or a list, errors may include path information in the context.
 
string $errorCode
 
string $errorMessage
 
array $errorContext
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::__construct ( string $code,
string $message,
array $context = [] )

Member Function Documentation

◆ getErrorCode()

Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::getErrorCode ( )

◆ getErrorContext()

Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::getErrorContext ( )

◆ getErrorMessage()

Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::getErrorMessage ( )

◆ newDataPolicyViolation()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newDataPolicyViolation ( string $violationCode,
array $violationContext )
static

◆ newInvalidKey()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newInvalidKey ( string $path,
string $key )
static

◆ newInvalidValue()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newInvalidValue ( string $path)
static

◆ newMissingField()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newMissingField ( string $path,
string $field )
static

◆ newMissingFieldInPatchResult()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newMissingFieldInPatchResult ( string $path,
string $field )
static

◆ newPatchResultInvalidKey()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newPatchResultInvalidKey ( string $path,
string $key )
static

◆ newPatchResultInvalidValue()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newPatchResultInvalidValue ( string $path,
$value )
static
Parameters
string$path
mixed$value
Returns
self

◆ newPatchResultModifiedReadOnlyValue()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newPatchResultModifiedReadOnlyValue ( string $path)
static

◆ newPatchResultResourceNotFound()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newPatchResultResourceNotFound ( string $path,
string $value )
static

◆ newPermissionDenied()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newPermissionDenied ( string $reason)
static

◆ newResourceNotFound()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newResourceNotFound ( string $resourceType)
static

◆ newValueTooLong()

static Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::newValueTooLong ( string $path,
int $maxLength,
bool $isPatchRequest = false )
static

Member Data Documentation

◆ $errorCode

string Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::$errorCode
private

◆ $errorContext

array Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::$errorContext
private

◆ $errorMessage

string Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::$errorMessage
private

◆ ADDITIONAL_PATH_CONTEXT

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::ADDITIONAL_PATH_CONTEXT
private
Initial value:
= [
self::SITELINK_TITLE_NOT_FOUND => [ self::CONTEXT_SITE_ID ],
]
const CONTEXT_SITE_ID
Definition UseCaseError.php:66

Depending on the use case and whether it's operating on a single resource or a list, errors may include path information in the context.

◆ CANNOT_MODIFY_READ_ONLY_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CANNOT_MODIFY_READ_ONLY_VALUE = 'cannot-modify-read-only-value'

◆ CONTEXT_ACTUAL_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_ACTUAL_VALUE = 'actual_value'

◆ CONTEXT_CONFLICTING_ITEM_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_CONFLICTING_ITEM_ID = 'conflicting_item_id'

◆ CONTEXT_CONFLICTING_PROPERTY_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_CONFLICTING_PROPERTY_ID = 'conflicting_property_id'

◆ CONTEXT_DESCRIPTION

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_DESCRIPTION = 'description'

◆ CONTEXT_FIELD

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_FIELD = 'field'

◆ CONTEXT_ITEM_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_ITEM_ID = 'item_id'

◆ CONTEXT_KEY

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_KEY = 'key'

◆ CONTEXT_LABEL

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_LABEL = 'label'

◆ CONTEXT_LANGUAGE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_LANGUAGE = 'language'

◆ CONTEXT_LIMIT

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_LIMIT = 'limit'

◆ CONTEXT_PARAMETER

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_PARAMETER = 'parameter'

◆ CONTEXT_PATH

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_PATH = 'path'

◆ CONTEXT_PROPERTY_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_PROPERTY_ID = 'property_id'

◆ CONTEXT_REASON

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_REASON = 'reason'

◆ CONTEXT_REDIRECT_TARGET

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_REDIRECT_TARGET = 'redirect_target'

◆ CONTEXT_RESOURCE_TYPE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_RESOURCE_TYPE = 'resource_type'

◆ CONTEXT_SITE_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_SITE_ID = 'site_id'

◆ CONTEXT_STATEMENT_GROUP_PROPERTY_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_STATEMENT_GROUP_PROPERTY_ID = 'statement_group_property_id'

◆ CONTEXT_STATEMENT_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_STATEMENT_ID = 'statement_id'

◆ CONTEXT_STATEMENT_PROPERTY_ID

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_STATEMENT_PROPERTY_ID = 'statement_property_id'

◆ CONTEXT_TITLE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_TITLE = 'title'

◆ CONTEXT_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_VALUE = 'value'

◆ CONTEXT_VIOLATION

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_VIOLATION = 'violation'

◆ CONTEXT_VIOLATION_CONTEXT

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::CONTEXT_VIOLATION_CONTEXT = 'violation_context'

◆ DATA_POLICY_VIOLATION

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::DATA_POLICY_VIOLATION = 'data-policy-violation'

◆ EXPECTED_CONTEXT_KEYS

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::EXPECTED_CONTEXT_KEYS

◆ INVALID_KEY

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::INVALID_KEY = 'invalid-key'

◆ INVALID_PATH_PARAMETER

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::INVALID_PATH_PARAMETER = 'invalid-path-parameter'

◆ INVALID_QUERY_PARAMETER

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::INVALID_QUERY_PARAMETER = 'invalid-query-parameter'

◆ INVALID_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::INVALID_VALUE = 'invalid-value'

◆ ITEM_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::ITEM_NOT_FOUND = 'item-not-found'

◆ ITEM_REDIRECTED

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::ITEM_REDIRECTED = 'redirected-item'

◆ ITEM_STATEMENT_ID_MISMATCH

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::ITEM_STATEMENT_ID_MISMATCH = 'item-statement-id-mismatch'

◆ MISSING_FIELD

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::MISSING_FIELD = 'missing-field'

◆ PATCH_RESULT_INVALID_KEY

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_INVALID_KEY = 'patch-result-invalid-key'

◆ PATCH_RESULT_INVALID_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_INVALID_VALUE = 'patch-result-invalid-value'

◆ PATCH_RESULT_MISSING_FIELD

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_MISSING_FIELD = 'patch-result-missing-field'

◆ PATCH_RESULT_MODIFIED_READ_ONLY_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_MODIFIED_READ_ONLY_VALUE = 'patch-result-modified-read-only-value'

◆ PATCH_RESULT_REFERENCED_RESOURCE_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_REFERENCED_RESOURCE_NOT_FOUND = 'patch-result-referenced-resource-not-found'

◆ PATCH_RESULT_VALUE_TOO_LONG

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_RESULT_VALUE_TOO_LONG = 'patch-result-value-too-long'

◆ PATCH_TARGET_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_TARGET_NOT_FOUND = 'patch-target-not-found'

◆ PATCH_TEST_FAILED

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCH_TEST_FAILED = 'patch-test-failed'

◆ PATCHED_INVALID_SITELINK_TYPE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCHED_INVALID_SITELINK_TYPE = 'patched-invalid-sitelink-type'

◆ PATCHED_SITELINK_URL_NOT_MODIFIABLE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCHED_SITELINK_URL_NOT_MODIFIABLE = 'url-not-modifiable'

◆ PATCHED_STATEMENT_GROUP_PROPERTY_ID_MISMATCH

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PATCHED_STATEMENT_GROUP_PROPERTY_ID_MISMATCH = 'patched-statement-group-property-id-mismatch'

◆ PERMISSION_DENIED

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PERMISSION_DENIED = 'permission-denied'

◆ PERMISSION_DENIED_REASON_PAGE_PROTECTED

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PERMISSION_DENIED_REASON_PAGE_PROTECTED = 'resource-protected'

◆ PERMISSION_DENIED_REASON_UNAUTHORIZED_BOT_EDIT

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PERMISSION_DENIED_REASON_UNAUTHORIZED_BOT_EDIT = 'unauthorized-bot-edit'

◆ PERMISSION_DENIED_REASON_USER_BLOCKED

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PERMISSION_DENIED_REASON_USER_BLOCKED = 'blocked-user'

◆ PERMISSION_DENIED_UNKNOWN_REASON

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PERMISSION_DENIED_UNKNOWN_REASON = 'permission-denied-unknown-reason'

◆ POLICY_VIOLATION_ITEM_LABEL_DESCRIPTION_DUPLICATE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::POLICY_VIOLATION_ITEM_LABEL_DESCRIPTION_DUPLICATE = 'item-label-description-duplicate'

◆ POLICY_VIOLATION_LABEL_DESCRIPTION_SAME_VALUE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::POLICY_VIOLATION_LABEL_DESCRIPTION_SAME_VALUE = 'label-description-same-value'

◆ POLICY_VIOLATION_PROPERTY_LABEL_DUPLICATE

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::POLICY_VIOLATION_PROPERTY_LABEL_DUPLICATE = 'property-label-duplicate'

◆ POLICY_VIOLATION_SITELINK_CONFLICT

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::POLICY_VIOLATION_SITELINK_CONFLICT = 'sitelink-conflict'

◆ PROPERTY_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PROPERTY_NOT_FOUND = 'property-not-found'

◆ PROPERTY_STATEMENT_ID_MISMATCH

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::PROPERTY_STATEMENT_ID_MISMATCH = 'property-statement-id-mismatch'

◆ RESOURCE_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::RESOURCE_NOT_FOUND = 'resource-not-found'

◆ SITELINK_TITLE_NOT_FOUND

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::SITELINK_TITLE_NOT_FOUND = 'title-does-not-exist'

◆ STATEMENT_GROUP_PROPERTY_ID_MISMATCH

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::STATEMENT_GROUP_PROPERTY_ID_MISMATCH = 'statement-group-property-id-mismatch'

◆ UNEXPECTED_ERROR

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::UNEXPECTED_ERROR = 'unexpected-error'

◆ VALUE_TOO_LONG

const Wikibase\Repo\RestApi\Application\UseCases\UseCaseError::VALUE_TOO_LONG = 'value-too-long'

The documentation for this class was generated from the following file: