-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component: better waiting for inputs api
- Loading branch information
Showing
5 changed files
with
39 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
package component | ||
|
||
import "errors" | ||
import ( | ||
"errors" | ||
"fmt" | ||
) | ||
|
||
var ( | ||
//@TODO: provide wrapper methods so exact input can be specified within error | ||
ErrWaitingForInputResetInputs = errors.New("component is waiting for one or more inputs. All inputs will be reset") | ||
ErrWaitingForInputKeepInputs = errors.New("component is waiting for one or more inputs. All inputs will be kept") | ||
errWaitingForInputs = errors.New("component is waiting for some inputs") | ||
errWaitingForInputsKeep = fmt.Errorf("%w: do not clear input ports", errWaitingForInputs) | ||
) | ||
|
||
func IsWaitingForInputError(err error) bool { | ||
return errors.Is(err, ErrWaitingForInputResetInputs) || errors.Is(err, ErrWaitingForInputKeepInputs) | ||
// NewErrWaitForInputs returns respective error | ||
func NewErrWaitForInputs(keepInputs bool) error { | ||
if keepInputs { | ||
return errWaitingForInputsKeep | ||
} | ||
return errWaitingForInputs | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters