@@ -38,14 +38,17 @@ export class ApolloError extends ExtendableError {
38
38
// NOTE: The object passed to the Constructor is actually `ctorData`.
39
39
// We are binding the constructor to the name and config object
40
40
// for the first two parameters inside of `createError`
41
- constructor ( name : string , config : ErrorConfig , ctorData : any ) {
42
- super ( ( ctorData && ctorData . message ) || '' ) ;
43
-
44
- const t = ( ctorData && ctorData . time_thrown ) || ( new Date ( ) ) . toISOString ( ) ;
45
- const m = ( ctorData && ctorData . message ) || '' ;
46
- const configData = ( ctorData && ctorData . data ) || { } ;
47
- const d = { ...this . data , ...configData } ;
48
- const opts = ( ( ctorData && ctorData . options ) || { } ) ;
41
+ constructor ( name : string , config : ErrorConfig , ctorConfig : ErrorConfig ) {
42
+ super ( ( ctorConfig && ctorConfig . message ) || ( config && config . message ) || '' ) ;
43
+
44
+ const t = ( ctorConfig && ctorConfig . time_thrown ) || ( config && config . time_thrown ) || ( new Date ( ) ) . toISOString ( ) ;
45
+ const m = ( ctorConfig && ctorConfig . message ) || ( config && config . message ) || '' ;
46
+ const ctorData = ( ctorConfig && ctorConfig . data ) || { } ;
47
+ const configData = ( config && config . data ) || { } ;
48
+ const d = { ...this . data , ...configData , ...ctorData } ;
49
+ const ctorOptions = ( ctorConfig && ctorConfig . options ) || { } ;
50
+ const configOptions = ( config && config . options ) || { } ;
51
+ const opts = { ...configOptions , ...ctorOptions } ;
49
52
50
53
51
54
this . name = name ;
0 commit comments