1
0
Fork 0
mirror of synced 2024-07-06 15:11:21 +12:00

Merge remote-tracking branch 'origin/refactor-usage-sn-invalid-relationship' into feat-upgrade-db

# Conflicts:
#	composer.lock
This commit is contained in:
Jake Barnby 2024-04-29 20:54:44 +12:00
commit bcca318494
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
3 changed files with 11 additions and 0 deletions

View file

@ -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 => [

View file

@ -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();

View file

@ -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';