Skip to content

Commit fb10bb6

Browse files
committed
feat: add statusMessage to AbortOptions
1 parent fd1b876 commit fb10bb6

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

packages/apify/src/actor.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,13 @@ export class Actor<Data extends Dictionary = Dictionary> {
337337
* @ignore
338338
*/
339339
async abort(runId: string, options: AbortOptions = {}): Promise<ClientActorRun> {
340-
const { token, ...rest } = options;
340+
const { token, statusMessage, ...rest } = options;
341341
const client = token ? this.newClient({ token }) : this.apifyClient;
342342

343+
if (statusMessage) {
344+
await this.setStatusMessage(statusMessage);
345+
}
346+
343347
return client.run(runId).abort(rest);
344348
}
345349

@@ -1460,6 +1464,9 @@ export interface AbortOptions extends RunAbortOptions {
14601464
* User API token that is used to run the actor. By default, it is taken from the `APIFY_TOKEN` environment variable.
14611465
*/
14621466
token?: string;
1467+
1468+
/** Exit with given status message */
1469+
statusMessage?: string;
14631470
}
14641471

14651472
export interface WebhookOptions {

0 commit comments

Comments
 (0)