UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

30 lines 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ListItemNotFoundError = void 0; const ErrorSerialiser_1 = require("../ErrorSerialiser"); const RuntimeError_1 = require("./RuntimeError"); /** * Thrown to indicate that an [`Interaction`](https://serenity-js.org/api/core/class/Interaction/), a [`Task`](https://serenity-js.org/api/core/class/Task/) or a test scenario * can't be executed due to no items are found in a list. * * For example, it's not possible to get the first() or the last() item of a list * if the list is empty. * * @group Errors */ class ListItemNotFoundError extends RuntimeError_1.RuntimeError { static fromJSON(serialised) { const error = new ListItemNotFoundError(serialised.message, ErrorSerialiser_1.ErrorSerialiser.deserialise(serialised.cause)); error.stack = serialised.stack; return error; } /** * @param message - Human-readable description of the error * @param [cause] - The root cause of this [`ListItemNotFoundError`](https://serenity-js.org/api/core/class/ListItemNotFoundError/), if any */ constructor(message, cause) { super(ListItemNotFoundError, message, cause); } } exports.ListItemNotFoundError = ListItemNotFoundError; //# sourceMappingURL=ListItemNotFoundError.js.map