Skip to content

Commit

Permalink
Merge pull request #37 from lxcid/lxcid/merging
Browse files Browse the repository at this point in the history
Rename ctorData to ctorConfig
  • Loading branch information
thebigredgeek authored Apr 11, 2018
2 parents 47a8e67 + b7fdcd9 commit 76508ce
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ export class ApolloError extends ExtendableError {
// NOTE: The object passed to the Constructor is actually `ctorData`.
// We are binding the constructor to the name and config object
// for the first two parameters inside of `createError`
constructor(name: string, config: ErrorConfig, ctorData: any) {
super((ctorData && ctorData.message) || '');

const t = (ctorData && ctorData.time_thrown) || (new Date()).toISOString();
const m = (ctorData && ctorData.message) || '';
const configData = (ctorData && ctorData.data) || {};
const d = { ...this.data, ...configData };
const opts = ((ctorData && ctorData.options) || {});
constructor(name: string, config: ErrorConfig, ctorConfig: ErrorConfig) {
super((ctorConfig && ctorConfig.message) || (config && config.message) || '');

const t = (ctorConfig && ctorConfig.time_thrown) || (config && config.time_thrown) || (new Date()).toISOString();
const m = (ctorConfig && ctorConfig.message) || (config && config.message) || '';
const ctorData = (ctorConfig && ctorConfig.data) || {};
const configData = (config && config.data) || {};
const d = { ...this.data, ...configData, ...ctorData };
const ctorOptions = (ctorConfig && ctorConfig.options) || {};
const configOptions = (config && config.options) || {};
const opts = { ...configOptions, ...ctorOptions };


this.name = name;
Expand Down

0 comments on commit 76508ce

Please sign in to comment.