Back

AppwriteException: general_unknown, Server Error (500) is shown instead of specified error

  • 0
  • Databases
  • Flutter
steve jobs
7 May, 2023, 06:06

steps to reproduce :

  1. create 2 collections, host and target.
  2. in host collection, add a one to one or many to one relationship to target collection with attribute name target_document.
  3. create a document in target with an ID = "12345"
  4. using dart SDK , create a host document databases.createDocument and it the data, give the target document ID (of relationship) as integer instead of a string.
TypeScript
data = {
    "target_document" : 12345,
  };

in the appwrite logs, its pointing out the correct error as in image below: Message: Invalid relationship value. Must be either a document, document ID, or an array of documents or document IDs.

but in the dart SDK , its throwing general_unknown(500) error. which is very hard to identify and debug. in SDK it should show correct error that "given relationship ID in invalid" or something like that.

TL;DR
The user is experiencing an issue with the Appwrite SDK where the specific error message is not displayed. They provide steps to reproduce the issue and mention that in the Appwrite logs, the correct error message is shown. However, in the Dart SDK, it only displays a general_unknown (500) error, making it difficult to identify and debug the issue. Solution: The user suggests creating a GitHub issue for changes to Appwrite.
Drake
7 May, 2023, 14:36

Sounds like you know the solution to this already. It's best to create a GitHub issue for changes to Appwrite

steve jobs
8 May, 2023, 06:54

this is just a made up case to demonstrate the some exceptions given by the SDK is vague (Server Error (500) ) instead of specific. so its hard to debug without using appwrite log.

steve jobs
8 May, 2023, 06:56

i wish to get more specific exceptions in the SDk (dart).

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more