File tree Expand file tree Collapse file tree 1 file changed +6
-22
lines changed Expand file tree Collapse file tree 1 file changed +6
-22
lines changed Original file line number Diff line number Diff line change 1
- export interface ReactiveDBException extends Error { }
1
+ export class ReactiveDBException extends Error {
2
2
3
- export interface ReactiveDBExceptionCtor {
4
- new ( message : string ) : ReactiveDBException
5
- readonly prototype : ReactiveDBException
6
- }
7
-
8
- function ReactiveDBExceptionCtor ( this : ReactiveDBException , message : string ) : ReactiveDBException {
9
- const err = Error . call ( this , message )
10
- this . name = err . name
11
- this . message = message
12
- this . stack = err . stack
13
- return this
14
- }
15
-
16
- ReactiveDBExceptionCtor . prototype = Object . create ( Error . prototype , {
17
- constructor : {
18
- value : ReactiveDBExceptionCtor ,
19
- enumerable : false ,
20
- writable : true ,
21
- configurable : true
3
+ constructor ( message : string ) {
4
+ super ( message )
5
+ this . name = 'ReactiveDBError' ;
6
+ ( Object as any ) . setPrototypeOf ( this , ReactiveDBException . prototype )
22
7
}
23
- } )
24
8
25
- export const ReactiveDBException = ReactiveDBExceptionCtor as any as ReactiveDBExceptionCtor
9
+ }
You can’t perform that action at this time.
0 commit comments