Skip to content

Improve the error when SQLite database file is locked #10403

@aqrln

Description

@aqrln

We had a test that attempted concurrent writes to SQLite. Since quaint maps SQLite’s DatabaseBusy error to SocketTimeout, and there’s no case for the (ErrorKind::SocketTimeout, ConnectionInfo::Sqlite { .. }) pair in user_facing_errors::quaint::render_quaint_error, the error looked like this:

      Error occurred during query execution:
    ConnectorError(ConnectorError { user_facing_error: None, kind: ConnectionError(Timed out during query execution.) })

      161 |         throw new PrismaClientRustPanicError(message, this.client._clientVersion)
      162 |       } else if (e instanceof PrismaClientUnknownRequestError) {
    > 163 |         throw new PrismaClientUnknownRequestError(message, this.client._clientVersion)
          |               ^

It would be nice to have some user-facing error with the correct message here (e.g., “The database file is locked”).


The updated source code link is: https://github.com/prisma/prisma-engines/blob/b567896ae76a9c991a5aca05b09b97c7628357cd/quaint/src/connector/sqlite/error.rs#L87-L96.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions