Error DataTypes
This page lists all Error DataTypes available through the OXAPI, together with
their error codes and the human-readable messages attached to those codes.
It covers both the types shipped by graphql-base and the types (and additional
codes) contributed by the graphql-storefront-administration module.
Error DataTypes are the type-safe, schema-visible way of returning client-facing
errors as part of a payload’s userErrors array (see Error-Handling).
Every Error DataType implements ErrorInterface and therefore always exposes a
code and a message field. Specific error types add further type-specific
fields (for example productId or inputPosition) which can be queried via
inline fragments.
Base infrastructure
Every Error DataType is built on ErrorInterface (namespace
OxidEsales\GraphQL\Base\DataType\Error). As a GraphQL Type it defines the
contract shared by all errors and guarantees that a code and a message
field are always available.
Error DataTypes provided by graphql-base
The graphql-base module ships the following concrete Error DataTypes. Codes
follow the oegqlb.<category>.<name> naming scheme (oegqlb = oxid
eSales graphql-base).
AuthenticationError
Constant |
Code |
Message |
|---|---|---|
|
|
The provided credentials are invalid. |
|
|
The token quota for this user has been exceeded. |
NotFoundError
Extra fields: identifier: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The token was not found. |
|
|
The user was not found. |
ValidationError
Extra fields: value: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The fingerprint validation failed. |
|
|
The provided refresh token is invalid. |
Generic Error DataTypes (no predefined codes)
The following Error DataTypes are reusable building blocks for
create/update/delete/uniqueness flows. They do not ship predefined code
constants — the code and message are supplied by the consuming module
(see Additional codes for graphql-base error types for how graphql-storefront-administration
extends them). Each exposes an additional identifier: String! field.
Type |
Extra fields |
Intended use |
|---|---|---|
|
|
A record could not be created. |
|
|
A record could not be updated. |
|
|
A record could not be deleted. |
|
|
A record with the given id already exists. |
Error DataTypes provided by graphql-storefront-administration
The graphql-storefront-administration module contributes error codes in two
ways: it defines its own new Error DataTypes (living under each domain’s
DataType/Error directory), and it extends the generic graphql-base
errors with module-specific codes (collected under Shared/DataType/Error).
All codes contributed by this module follow the oegqlsa.<category>.<name>
naming scheme (oegqlsa = oxid eSales graphql
storefront-administration).
The module’s own Error DataTypes carry an Admin prefix in the GraphQL
schema. The extended graphql-base errors keep their base type names.
AdminDownloadFileError
Extra fields: fileId: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
You cannot delete this file, as long as it has valid downloads. |
AdminImportError
Extra fields: inputPosition: Int! — the position of the failing entry in the
import input list.
This type has no predefined codes; the code and message are provided
dynamically per failing import entry (they are propagated from the underlying
error that occurred while importing that entry).
Example
While importing a list of products, one entry fails (e.g. the second product
fails with an IdAlreadyExistsError). Its code and message are copied
into an AdminImportError, and inputPosition is set to the position of the
failing entry (1-based). That AdminImportError is then returned in the
payload’s userErrors:
// $inputPosition = 2 (second product in the input list)
new ImportError($error->code(), $error->message(), $inputPosition);
// -> code: "oegqlsa.id_already_exists.product"
// message: "A product with the provided ID already exists."
// inputPosition: 2
AdminProductError
Extra fields: productId: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The product is a variant. |
|
|
The product is not a variant. |
|
|
The parent product is a variant. |
|
|
The product could not be saved. |
AdminProductAttributeError
Extra fields: productId: String!, attributeId: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The product already has this attribute assigned. |
|
|
The product does not have this attribute assigned. |
AdminProductCategoryError
Extra fields: categoryId: String!, productId: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The category is already assigned to the product. |
|
|
The category is not assigned to the product. |
|
|
A price category cannot be assigned to a product. |
AdminProductShopError
Extra fields: productId: String!, subshopId: Int!.
Constant |
Code |
Message |
|---|---|---|
|
|
The product is already assigned to the subshop. |
|
|
The product is not assigned to the subshop. |
AdminProductSelectionListError
Extra fields: selectionListId: String!, productId: String!.
Constant |
Code |
Message |
|---|---|---|
|
|
The selection list is already assigned to the product. |
|
|
The selection list is not assigned to the product. |
|
|
The selection list could not be assigned to the product. |
AdminProductSeoError
Extra fields: productId: String!, seoType: SeoArticleType!,
relatedObjectId: String (nullable).
Constant |
Code |
Message |
|---|---|---|
|
|
The main SEO URL cannot be edited when the product has category, vendor or manufacturer assignments. |
|
|
The related object is not assigned to the product. |
|
|
A related object id is required for this SEO type. |
Additional codes for graphql-base error types
The module also extends the generic graphql-base Error DataTypes with its own
codes. These are not new GraphQL types — the errors returned are still the
base types (NotFoundError, ValidationError, NotCreatedError,
NotUpdatedError, NotDeletedError, IdAlreadyExistsError). The module
only registers additional oegqlsa.* codes and their messages for them.
NotFoundError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
The download file was not found. |
|
|
The download file was not found in the FTP directory. |
|
|
The product was not found. |
|
|
The product image was not found. |
|
|
The attribute was not found. |
|
|
The category was not found. |
|
|
The manufacturer was not found. |
|
|
The shop was not found. |
|
|
The state was not found. |
|
|
The country was not found. |
|
|
The scale price was not found. |
|
|
The selection list was not found. |
|
|
No language was found for the provided locale. |
ValidationError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
The product picture position is invalid. |
|
|
The product id is invalid. |
|
|
The shop is not a subshop of the current shop. |
|
|
The state id is invalid. |
|
|
The state ISO alpha-2 code is invalid. |
NotCreatedError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
An attribute with the provided ID could not be created. |
|
|
A download file with the provided ID could not be created. |
|
|
A scale price with the provided ID could not be created. |
|
|
A state with the provided ID could not be created. |
NotUpdatedError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
An attribute with the provided ID could not be updated. |
|
|
A download file with the provided ID could not be updated. |
|
|
The language fields of the product with the provided ID could not be updated. |
|
|
A scale price with the provided ID could not be updated. |
|
|
A state with the provided ID could not be updated. |
NotDeletedError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
An attribute with the provided ID could not be deleted. |
|
|
A product with the provided ID could not be deleted. |
|
|
A state with the provided ID could not be deleted. |
IdAlreadyExistsError (additional codes)
Constant |
Code |
Message |
|---|---|---|
|
|
An attribute with the provided ID already exists. |
|
|
A download file with the provided ID already exists. |
|
|
A product with the provided ID already exists. |
|
|
A scale price with the provided ID already exists. |
|
|
A state with the provided ID already exists. |
Summary
Module |
Error DataTypes |
Predefined codes |
|---|---|---|
|
8 (4 with codes, 4 generic) |
8 |
|
8 |
18 ( |
|
reuses 6 base types |
35 |