<commit_before>'use strict';

const contextBuilder = require( './context_builder' );

const lambdaLeak = require( 'lambda-leak' );

const utils = require( './utils' );

const DEFAULT_TIMEOUT = 3000; // s3

const XRAY_SETTLE_TIMEOUT = 20;

const xrayServer = require( './xray' );

function convertError( err ) {

    if( utils.isString( err ) ) {

        err = new Error( err );
    }

    return err;
}

class FailError extends Error {

    constructor( message, cause, result ) {

        super( message );

        this.cause = convertError( cause );
        this.result = result;
    }
}


function detectLeaks( capturedState ) {

    if( capturedState ) {

        let handleDifference = capturedState.getDifferenceInHandles();

        if( handleDifference.length > 0 ) {
<commit_msg>Keep the real stack for error reporters<commit_after>'use strict';

const contextBuilder = require( './context_builder' );

const lambdaLeak = require( 'lambda-leak' );

const utils = require( './utils' );

const DEFAULT_TIMEOUT = 3000; // s3

const XRAY_SETTLE_TIMEOUT = 20;

const xrayServer = require( './xray' );

function convertError( err ) {

    if( utils.isString( err ) ) {

        err = new Error( err );
    }

    return err;
}

class FailError extends Error {

    constructor( message, cause, result ) {

        super( message );

        this.cause = convertError( cause );
        this.result = result;
        this.stack = cause.stack;
    }
}


function detectLeaks( capturedState ) {

    if( capturedState ) {

        let handleDifference = capturedState.getDifferenceInHandles();

        if( handleDifference.length > 0 ) {

{'fraction_non_alphanumeric': 0.11707317073170732, 'fraction_numerical': 0.00975609756097561, 'mean_word_length': 2.816279069767442, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4767111', 'n_tokens_mistral': 517, 'n_tokens_neox': 490, 'n_words': 134}