<commit_before>'use strict';

let mmError = function(code, msg, toString) {
  return function(data, message) {
    let err = new Error();
    err.code = code;
    err.message = msg;

    if (message) {
      err.message += '. ' + message;
    }

    if (data) {
      err.data = data;
    }

    if (toString) {
      err.toString = toString;
    }

    return err;
  }
}

//generic error
const Call                = mmError(4000, 'Error'); //general error to return from your methods

//auth errors
const Unauthorized        = mmError(4100, 'Unauthorized');
const Forbidden           = mmError(4110, 'Forbidden');
const NotValidToken       = mmError(4120, 'Token not valid or expired');

//validation errors
const RequestValidation   = mmError(4200, 'Request validation failed');
const ResponseValidation  = mmError(4210, 'Response validation failed');
const RequestTooLarge     = mmError(4220, 'Request entity too large');
const RequestDecode       = mmError(4230, 'Request decode error');
const ResponseEncode      = mmError(4240, 'Response encode error');
const UnsupportedMedia    = mmError(4250, 'Unsupported media');

//call errors
const MethodNotFound      = mmError(4400, 'Method not found');
const ChannelNotFound     = mmError(4410, 'Channel not found');

//response errors
const Duplicate           = mmError(4500, 'Duplicate entity');
const NotFound            = mmError(4540, 'Not found');

//server errors
const ServerError         = mmError(5000, 'Server error');

module.exports = {
  Error: mmError,
  Call,
  Unauthorized,
  Forbidden,
  NotValidToken,
  RequestValidation,
  ResponseValidation,
  RequestTooLarge,
  RequestDecode,
  ResponseEncode,
  UnsupportedMedia,
  MethodNotFound,
  ChannelNotFound,

  Duplicate,
  NotFound,

  ServerError
};

<commit_msg>Added ProviderNotFound error<commit_after>'use strict';

let mmError = function(code, msg, toString) {
  return function(data, message) {
    let err = new Error();
    err.code = code;
    err.message = msg;

    if (message) {
      err.message += '. ' + message;
    }

    if (data) {
      err.data = data;
    }

    if (toString) {
      err.toString = toString;
    }

    return err;
  }
}

//generic error
const Call                = mmError(4000, 'Error'); //general error to return from your methods

//auth errors
const Unauthorized        = mmError(4100, 'Unauthorized');
const ProviderNotFound    = mmError(4104, 'Auth provider not found');
const Forbidden           = mmError(4110, 'Forbidden');
const NotValidToken       = mmError(4120, 'Token not valid or expired');

//validation errors
const RequestValidation   = mmError(4200, 'Request validation failed');
const ResponseValidation  = mmError(4210, 'Response validation failed');
const RequestTooLarge     = mmError(4220, 'Request entity too large');
const RequestDecode       = mmError(4230, 'Request decode error');
const ResponseEncode      = mmError(4240, 'Response encode error');
const UnsupportedMedia    = mmError(4250, 'Unsupported media');

//call errors
const MethodNotFound      = mmError(4400, 'Method not found');
const ChannelNotFound     = mmError(4410, 'Channel not found');

//response errors
const Duplicate           = mmError(4500, 'Duplicate entity');
const NotFound            = mmError(4540, 'Not found');

//server errors
const ServerError         = mmError(5000, 'Server error');

module.exports = {
  Error: mmError,
  Call,
  Unauthorized,
  Forbidden,
  NotValidToken,
  RequestValidation,
  ResponseValidation,
  RequestTooLarge,
  RequestDecode,
  ResponseEncode,
  UnsupportedMedia,
  MethodNotFound,
  ChannelNotFound,

  Duplicate,
  NotFound,

  ServerError
};


{'fraction_non_alphanumeric': 0.10873733223774308, 'fraction_numerical': 0.03396329772665023, 'mean_word_length': 3.306603773584906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2576927', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1054, 'n_words': 313}