Better database errors in worker thread
This commit is contained in:
parent
2cbc1a82b2
commit
6143888f6c
3 changed files with 21 additions and 8 deletions
|
@ -70,7 +70,13 @@ export type WrappedWorkerResponse =
|
|||
| Readonly<{
|
||||
type: 'response';
|
||||
seq: number;
|
||||
error: string | undefined;
|
||||
error:
|
||||
| Readonly<{
|
||||
name: string;
|
||||
message: string;
|
||||
stack: string | undefined;
|
||||
}>
|
||||
| undefined;
|
||||
errorKind: SqliteErrorKind | undefined;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
response: any;
|
||||
|
@ -382,7 +388,9 @@ export class MainSQL {
|
|||
}
|
||||
|
||||
if (error) {
|
||||
const errorObj = new Error(error);
|
||||
const errorObj = new Error(error.message);
|
||||
errorObj.stack = error.stack;
|
||||
errorObj.name = error.name;
|
||||
this.onError(errorKind ?? SqliteErrorKind.Unknown, errorObj);
|
||||
|
||||
pair.reject(errorObj);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue