Back

Type Mismatch in AppwriteException

  • 0
  • Databases
M Zeeshan
11 Dec, 2024, 03:57

There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in practice, it is actually an object, as evidenced by the following logged output:

TypeScript
{
  name: 'AppwriteException',
  code: 404,
  type: 'document_not_found',
  response: {
    message: 'Document with the requested ID could not be found.',
    code: 404,
    type: 'document_not_found',
    version: '1.6.1',
  },
}

This mismatch between the type definition and the actual runtime behavior can lead to type-related issues in TypeScript projects.

TL;DR
Issue: TypeScript type definitions for AppwriteException have a discrepancy with the actual runtime behavior. The response property is defined as a string but is actually an object. Solution: Update the TypeScript type definitions for AppwriteException to correctly reflect that the response property is an object, not a string.
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