Merge remote-tracking branch 'origin/refactor-usage-sn-invalid-relationship' into feat-upgrade-db
# Conflicts: # composer.lock
This commit is contained in:
commit
bcca318494
3 changed files with 11 additions and 0 deletions
|
@ -668,6 +668,11 @@ return [
|
|||
'description' => 'The attribute type is invalid.',
|
||||
'code' => 400,
|
||||
],
|
||||
Exception::RELATIONSHIP_VALUE_INVALID => [
|
||||
'name' => Exception::RELATIONSHIP_VALUE_INVALID,
|
||||
'description' => 'The relationship value is invalid.',
|
||||
'code' => 400,
|
||||
],
|
||||
|
||||
/** Indexes */
|
||||
Exception::INDEX_NOT_FOUND => [
|
||||
|
|
|
@ -682,6 +682,9 @@ App::error()
|
|||
case 'Utopia\Database\Exception\Authorization':
|
||||
$error = new AppwriteException(AppwriteException::USER_UNAUTHORIZED);
|
||||
break;
|
||||
case 'Utopia\Database\Exception\Relationship':
|
||||
$error = new AppwriteException(AppwriteException::RELATIONSHIP_VALUE_INVALID, $error->getMessage(), previous: $error);
|
||||
break;
|
||||
}
|
||||
|
||||
$code = $error->getCode();
|
||||
|
|
|
@ -195,6 +195,9 @@ class Exception extends \Exception
|
|||
public const ATTRIBUTE_VALUE_INVALID = 'attribute_value_invalid';
|
||||
public const ATTRIBUTE_TYPE_INVALID = 'attribute_type_invalid';
|
||||
|
||||
/** Relationship */
|
||||
public const RELATIONSHIP_VALUE_INVALID = 'relationship_value_invalid';
|
||||
|
||||
/** Indexes */
|
||||
public const INDEX_NOT_FOUND = 'index_not_found';
|
||||
public const INDEX_LIMIT_EXCEEDED = 'index_limit_exceeded';
|
||||
|
|
Loading…
Reference in a new issue