nci-ats/fs-middlelayer-api

View on GitHub
src/controllers/errors/duplicateContactsError.js

Summary

Maintainability
A
0 mins
Test Coverage
/*

  ___ ___       ___               _ _       _   ___ ___ 
 | __/ __|  ___| _ \___ _ _ _ __ (_) |_    /_\ | _ \_ _|
 | _|\__ \ / -_)  _/ -_) '_| '  \| |  _|  / _ \|  _/| | 
 |_| |___/ \___|_| \___|_| |_|_|_|_|\__| /_/ \_\_| |___|

*/

//*******************************************************************

'use strict';

//*******************************************************************

module.exports = function DuplicateContactsError(duplicateContacts) {
    Error.captureStackTrace(this, this.constructor);
    this.name = this.constructor.name;
    this.message = duplicateContacts.length + ' duplicate contacts found!';
    if (duplicateContacts) this.duplicateContacts = duplicateContacts;
};

require('util').inherits(module.exports, Error);