UNPKG

@gatling.io/core

Version:

Gatling JS is a JavaScript/TypeScript interface for the [Gatling load testing tool](https://gatling.io/).

62 lines (61 loc) 2.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.errorsImpl = void 0; const session_1 = require("../session"); const on_1 = require("./on"); const errorsImpl = (jvmErrors, wrap) => ({ exitBlockOnFail: () => (0, on_1.wrapOn)(jvmErrors.exitBlockOnFail(), wrap), tryMax: (times) => (0, on_1.wrapOn)(typeof times === "function" ? jvmErrors.tryMax((0, session_1.underlyingSessionTo)(times)) : typeof times === "string" ? jvmErrors.tryMax(times) : jvmErrors.tryMax(times), wrap), exitHereIf: (condition) => wrap(typeof condition === "function" ? jvmErrors.exitHereIf((0, session_1.underlyingSessionTo)(condition)) : jvmErrors.exitHereIf(condition)), exitHere: () => wrap(jvmErrors.exitHere()), exitHereIfFailed: () => wrap(jvmErrors.exitHereIfFailed()), stopLoadGenerator: (message) => wrap(typeof message === "function" ? jvmErrors.stopLoadGenerator((0, session_1.underlyingSessionTo)(message)) : jvmErrors.stopLoadGenerator(message)), stopLoadGeneratorIf: (message, condition) => { if (typeof message === "function") { if (typeof condition === "function") { return wrap(jvmErrors.stopLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), (0, session_1.underlyingSessionTo)(condition))); } else { return wrap(jvmErrors.stopLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), condition)); } } else { if (typeof condition === "function") { return wrap(jvmErrors.stopLoadGeneratorIf(message, (0, session_1.underlyingSessionTo)(condition))); } else { return wrap(jvmErrors.stopLoadGeneratorIf(message, condition)); } } }, crashLoadGenerator: (message) => wrap(typeof message === "function" ? jvmErrors.crashLoadGenerator((0, session_1.underlyingSessionTo)(message)) : jvmErrors.crashLoadGenerator(message)), crashLoadGeneratorIf: (message, condition) => { if (typeof message === "function") { if (typeof condition === "function") { return wrap(jvmErrors.crashLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), (0, session_1.underlyingSessionTo)(condition))); } else { return wrap(jvmErrors.crashLoadGeneratorIf((0, session_1.underlyingSessionTo)(message), condition)); } } else { if (typeof condition === "function") { return wrap(jvmErrors.crashLoadGeneratorIf(message, (0, session_1.underlyingSessionTo)(condition))); } else { return wrap(jvmErrors.crashLoadGeneratorIf(message, condition)); } } } }); exports.errorsImpl = errorsImpl;