Skip to content

Commit cda55e6

Browse files
committed
refactor(driver-sqlite-wasm): name the refusal's code type
Claude-Session: https://claude.ai/code/session_015pbbff7SHh7EEEWiasBdDe Co-authored-by: Claude <noreply@anthropic.com>
1 parent e39b18e commit cda55e6

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/drivers/driver-sqlite-wasm/src/wasm-connection.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,11 @@ function unreadableDatabaseFileRefusal(
126126
return refusal;
127127
}
128128

129+
/** SQLite's own result-code names for a file it cannot read, as the native driver carries them. */
130+
type UnreadableDatabaseFileCode = 'SQLITE_NOTADB' | 'SQLITE_CORRUPT';
131+
129132
type UnreadableDatabaseFileRefusal = Error & {
130-
code: 'SQLITE_NOTADB' | 'SQLITE_CORRUPT';
133+
code: UnreadableDatabaseFileCode;
131134
filename: string;
132135
cause: unknown;
133136
};

0 commit comments

Comments
 (0)