Skip to content

@openfabr/cdf / Exports / ResultHandler

Class: ResultHandler

Abstract class for packages to implement in order to handle outputs or errors from the result.

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ResultHandler(onOk?, onErr?)

Parameters

Name Type Description
onOk? (outputs: InfraPlanOutputs) => void Function to handle results.
onErr? (error: PlanError) => void Function to to handle errors.

Defined in

src/lib/package.ts:87

Properties

onErr

Optional Readonly onErr: (error: PlanError) => void

Type declaration

▸ (error): void

Function to to handle errors.

Parameters
Name Type
error PlanError
Returns

void

Defined in

src/lib/package.ts:95


onOk

Optional Readonly onOk: (outputs: InfraPlanOutputs) => void

Type declaration

▸ (outputs): void

Function to handle results.

Parameters
Name Type
outputs InfraPlanOutputs
Returns

void

Defined in

src/lib/package.ts:91


DEFAULT

Static DEFAULT: ResultHandler

The default handler.

Defined in

src/lib/package.ts:85

Methods

handle

handle(result?): void

Function that handles infra provisioning result by delegating to onErr and onOk functions to be implemented.

Parameters

Name Type Description
result? Result<InfraPlanOutputs, PlanError> The result of infra provisioning.

Returns

void

Defined in

src/lib/package.ts:103