Skip to content
This repository was archived by the owner on Oct 9, 2023. It is now read-only.
This repository was archived by the owner on Oct 9, 2023. It is now read-only.

Exceptions need more granular types #277

Closed as not planned
Closed as not planned
@james-whiteside

Description

@james-whiteside

Problem to Solve

Exceptions need more granular types.

E.g. I run the query match $t sub {my_type}; with a user-defined string my_type. If I get TypeDBClientException, is it because the type my_type does not exist in the database, or because the string my_type contains illegal query characters? I should be able to try/except individually for these cases. Other similar cases exist, where currently most errors seem to just be TypeDBClientExceptions.

Current Workaround

I could process the exception message to get more information about the error as they seem to already be loosely typed. With reference to the above example, compare:

typedb.common.exception.TypeDBClientException: [TYR03] Invalid Type Read: The type 'relations' does not exist.
typedb.common.exception.TypeDBClientException: [TQL03] TypeQL Error: There is a syntax error at line 1:

but this is both inelegant and has potential for unintended behaviour.

Proposed Solution

Make exceptions more strongly typed.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions