@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
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
onOk
• Optional Readonly onOk: (outputs: InfraPlanOutputs) => void
Type declaration
▸ (outputs): void
Function to handle results.
Parameters
| Name | Type |
|---|---|
outputs | InfraPlanOutputs |
Returns
void
Defined in
DEFAULT
▪ Static DEFAULT: ResultHandler
The default handler.
Defined in
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