forked from mui/mui-x
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgridDataSourceError.ts
39 lines (33 loc) · 1 KB
/
gridDataSourceError.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { GridGetRowsParams, GridUpdateRowParams } from '../../../models/gridDataSource';
export class GridGetRowsError<T extends GridGetRowsParams = GridGetRowsParams> extends Error {
/**
* The parameters used in the failed request
*/
readonly params: T;
/**
* The original error that caused this error
*/
readonly cause?: Error;
constructor(options: { message: string; params: T; cause?: Error }) {
super(options.message);
this.name = 'GridGetRowsError';
this.params = options.params;
this.cause = options.cause;
}
}
export class GridUpdateRowError extends Error {
/**
* The parameters used in the failed request
*/
readonly params: GridUpdateRowParams;
/**
* The original error that caused this error
*/
readonly cause?: Error;
constructor(options: { message: string; params: GridUpdateRowParams; cause?: Error }) {
super(options.message);
this.name = 'GridUpdateRowError';
this.params = options.params;
this.cause = options.cause;
}
}